clear all
close all

Fs = 1024;
sigFreq = 64;
amplitude = 1.0;

time = 0:1/Fs:8/sigFreq-1/Fs;

sig256 = amplitude * sin(2*pi*sigFreq*time);

plot(sig256, '+-')

sigLength = length(sig256);
noWindow = ones(1, sigLength);

[Pxx, f] = pwelch(sig256,noWindow,0,sigLength,Fs);

figure
plot(f, Pxx, '+-');

ramp = 0:0.01:1.27;
rampSig256 = sig256 + ramp;

figure
plot(rampSig256, '+-');

[Pxx, f] = pwelch(rampSig256,noWindow,0,sigLength,Fs);

figure
plot(f, Pxx, '+-');

detrendRampSig256 = detrend(rampSig256);

figure
plot(detrendRampSig256, '+-');

[Pxx, f] = pwelch(detrendRampSig256,noWindow,0,sigLength,Fs);

figure
plot(f, Pxx, '+-');

