help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FFT: Finding signal frequency at wrong place


From: Isak Delberth Davids
Subject: FFT: Finding signal frequency at wrong place
Date: Sat, 4 Dec 2010 22:51:00 +0200

Hi octavers,

I do a FFT on the attached strictly increasing time data of gamma-ray signals as observed. I try to find any embedded frequencies. First I check if the code below works for user-defined frequencies. I thus add two known sine waves. Running the code, I find two frequencie, but at definitely wrong frequencies. Do I mess with frequency scaling or what? I expected the peaks near 0.1 and 0.05. Code at end

Cheers,
Isak

%________________________%
load time_series.dat
dataMatrix = time_series;
t = dataMatrix(:,1);

t_obs = max(t)-min(t);
L = length(t);

freq_samp = 1/(t_obs*60); % sampling frequency

freq_test1 = 0.1;
freq_test2 = 0.05;
ampl = 10^4;
t = t + ampl*sin(2*pi*freq_test1*t) +  ampl*sin(2*pi*freq_test2*t);

nFFT = 2^nextpow2(L);
Y_fft = fft(t,nFFT)/L;
freq = (freq_samp/2)*linspace(0,1,nFFT/2+1);
plot(freq,2*abs(Y_fft(1:nFFT/2+1)))
 %________________________%

Attachment: time_series.dat
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]