The FFT plot of my Signal does not Exhibit Clear Spikes as Expected.

1 view (last 30 days)
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);
mat.PNG
  2 Comments
Aquatris
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.
Nikitas Provatakis
Nikitas Provatakis on 15 Nov 2018
Thank you for the input. I understand the concept of using a logarithmic axis, but I believe semilogx() would prove in this case more helpful as I am trying to modify the frequency values in Hz. I will give both a try.
The existence of measurement errors is of course another possibility I should consider.

Sign in to comment.

Answers (0)

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!