The FFT plot of my Signal does not Exhibit Clear Spikes as Expected.
1 view (last 30 days)
Show older comments
I have collected some fluorescence time series data from some cortical cells. Let's consider a single cell, where the data is described by a row vector. In our case it is described by the signal variable. A low pass filter has been applied. The cutoff frequency in such a case is close to 1Hz. I used the code that follows to filter and create the power spectrum of the data. From my understanding, this would allow me to see the rate with which the cell fires which is supposed to be constant and be shown as a single spike after applying the FFT algorithm, but I get a messy spectrum with quite a lot of spikes, out of which none seems very prominent.
Wn=1;
n=2;
ftype='low';
[b,a]=butter(n,Wn/(Fs/2),ftype);
dataF=filtfilt(b,a,signal);
figure();
subplot(221); plot(signal);
subplot(222); plot(dataF);
F=fft(signal); L=length(signal);
P2=abs(F/L);
P1=P2(1:L/2+1);
P1(2:end-1)=2*P1(2:end-1);
f=Fs*(0:(L/2))/L;
subplot(223); plot(f,P1);
2 Comments
Aquatris
on 14 Nov 2018
Try to do the fft without filtering the signal. Maybe your filter is too agressive.
Another thing is use logarithmic scale. Instead of plot(), use semilogy().
Lastly, maybe your data is not what you think it is. There might be measurement errors, corrupted signals etc.
Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!