[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FFT: Finding signal frequency at wrong place
From: |
Judd Storrs |
Subject: |
Re: FFT: Finding signal frequency at wrong place |
Date: |
Sun, 5 Dec 2010 02:05:48 -0500 |
On Sat, Dec 4, 2010 at 3:51 PM, Isak Delberth Davids
<address@hidden> wrote:
> 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
I'm not familiar with gamma-ray signals and how to use the FFT to get
the frequencies (Is 't' a list of times that a gamma-ray was
detected?) However, I do know why you are not seeing your expected
peaks. The FFT expects uniformly sampled data and the 't' is not
uniformly sampled. In other words, after:
t = t + ampl*sin(2*pi*freq_test1*t) + ampl*sin(2*pi*freq_test2*t);
The artificial peaks will only show up correctly if diff(t) is
constant. For example, if you make a change like this:
T = linspace(min(t),max(t),numel(t))' ;
t = t + ampl*sin(2*pi*freq_test1*T) + ampl*sin(2*pi*freq_test2*T);
Then you will see two peaks added to your spectrum.
--judd