How to do a fft from a sine signal with hanning function

103 ビュー (過去 30 日間)
Jack Walker
Jack Walker 2016 年 10 月 4 日
コメント済み: David Pinho 2019 年 5 月 6 日
Hello, i want to do a fast fourier transformation on a sine signal. By using the hanning function. Btw i am a newbie, concering matlab programming so, dont be to hard too me. If you could also help me explain the hanning function properly, i would really appreciate it.

回答 (2 件)

Gareth Thomas
Gareth Thomas 2016 年 10 月 4 日
MATLAB has awesome help. If you type
doc fft
You should get a nice page with examples that should be enough to get you going: FFT in MATLAB
  1 件のコメント
Jack Walker
Jack Walker 2016 年 10 月 4 日
Thank you, i will try to read the link you provided it. Although tt is a little bit complicated to me xD

サインインしてコメントする。


Jan Orwat
Jan Orwat 2016 年 10 月 4 日
編集済み: Jan Orwat 2016 年 10 月 4 日
You can try starting with something like this
fs = 44100; % sampling frequency
T = 1; % period, 1 second
n = T*fs;
t = linspace(1/fs, T, n);
% calculate hanning window, if you have Signal Processing Toolbox just use hann(n)
window = 0.5 - 0.5*cos(2*pi*linspace(0, 1, n));
% generate simplest sine signal
freq = 1000; % 1kHz sine wave
s = sin(2*pi*freq);
% calculate fft
z = fft(s.*window);
hanning window is just 1 - one period of cosine function, it's usually normalised to 1.
  5 件のコメント
mehdi fathizad
mehdi fathizad 2019 年 3 月 23 日
hi everone
Now i am doing a project about damage detection of structure based on ARMA model. I have already taken all the accelerations for damaged and undamaged system and I want to use pre-whitening procedure to remove correlation between the story's responses. I read somewhere that for doing pre-whitening its better to do hanning window at first on my response time series. then carry out the fft fallowing the normalization. at the end, inverse FFT and then start the ARMA procedure on the obtained new time series.
I am wondering if its correct (whole concept and the arrangement)?
and also normalization means dividing all magnitude by the maximum amount?
if so, after producing the new time series, how can I check to find out the procedure was rigth or not?(for example checking the variance, mean and so on)
thanks
David Pinho
David Pinho 2019 年 5 月 6 日
s = sin(2*pi*freq); should be sin(2*pi*freq*t)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by