Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rajan

Posts: 5
Registered: 11/26/12
Spectral Properties of NOISE
Posted: Jun 18, 2014 6:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.