Spectral Properties of Noise
2 views (last 30 days)
Show older comments
Hello,
Please help me perform Power Spectral analysis of electrophysiological signal data recorded from an ion channel. I want to take fft of the Signal and plot it with frequency (log-log plot). and then I want linear fitting of the Power spectra. So that I can Calculate Slope or Noise Properties of PDS.
The Sampling frequency is 10 kHz Length of signal/Number of data point is 4096 Here is the code I am using
Fs = 10000; N = length(x); xdft = fft(x); xdft = xdft(1:N/2+1); psdx = (1/(Fs*N)).*abs(xdft).^2; psdx = 2*psdx; freq = (0:Fs/length(x):Fs/2)'; psdx = 10*log10(psdx); freq = (log10(freq)); plot(freq,psdx); grid on; title('Periodogram Using FFT'); xlabel('Frequency (10 kHz)'); ylabel('Power (dB/Hz)');
p = polyfit(freq,psdx,1) f = polyval(p,freq); hold on plot(freq,f,'r')
The Problem is that I am getting completly wrong Slope of my power spectra (I am comparing my results with the results of originlab software analysis.).
Please let me know what is wrong in my code.
0 Comments
Answers (0)
See Also
Categories
Find more on Parametric Spectral Estimation 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!