Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Spectral Properties of NOISE
Replies: 4   Last Post: Jun 20, 2014 8:53 AM

 Messages: [ Previous | Next ]
 Rajan Posts: 9 Registered: 11/26/12
Spectral Properties of NOISE
Posted: Jun 18, 2014 6:23 AM

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. -

Date Subject Author
6/18/14 Rajan
6/18/14 Matthew Crema
6/20/14 Rajan
6/20/14 Matthew Crema
6/20/14 Rajan