Frequency Analysis by Simulink

조회 수: 2 (최근 30일)
cyberdyne
cyberdyne 2011년 9월 7일
Hi,
Can someone explain me the steps to do spectral analysis of a signal that I have in a .mat file (sample rate used=1kHz).
I would like to display signal in frequency domain and extract some parameters as mean frequency.
I've tried to use spectrum scope block but it returns an error in some S-function.
Thanks
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2011년 9월 7일
What is the error message?

댓글을 달려면 로그인하십시오.

답변 (2개)

Rick Rosson
Rick Rosson 2011년 9월 7일
I would recommend trying it in MATLAB first. In the following code, I am assuming that the signal is stored in an M x 1 array called x, and that the sampling rate is a scalar called Fs:
filename = ...
x = load(filename);
Fs = 1000;
M = size(x,1);
dF = Fs/M;
f = -Fs/2:dF:Fs/2-dF;
X = fftshift(fft(x));
figure;
plot(f,abs(X));
HTH.
Rick
  댓글 수: 1
cyberdyne
cyberdyne 2011년 9월 15일
Ok. But I would like to make it by Simulink blocks (using .mat file block), how could I do it ?

댓글을 달려면 로그인하십시오.


Rick Rosson
Rick Rosson 2011년 9월 7일
Alternaitively, you could use the function freqz. For more information:
>> doc freqz
HTH.
Rick

카테고리

Help CenterFile Exchange에서 Spectral Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by