Help with removing the transient part in FFT

8 次查看(过去 30 天)
I want to remove the transient psrt from my fft of TE to clearly see the frequency components. I have tried removing the transient part say first 0.05 sec, but it doesn't work
My code is here: https://uk.mathworks.com/matlabcentral/answers/1937134-help-with-computing-fft?s_tid=prof_contriblnk

回答(1 个)

Bhanu Prakash
Bhanu Prakash 2023-5-12
Hi Siddharth,
As per my understanding, you want to remove the transient part in FFT.
To remove the transient part of FFT, you must apply a window function to the input signal before computing the FFT. Consider the code shown below:
N=128;
window_start=1;
window_stop=20;
x=rand(N,1);
x(window_start:window_stop)=x(window_start:window_stop).*hann(window_stop-window_start+1);
X=fft(x);
plot(abs(X));
where, "N" is the FFT size and "x" is a 128x1 matrix containing random values ranging in the range (0,1). To remove transient in a particular interval, "window_start" & "window_stop" are used.
The window function "hann" is applied to the values of "x" in the interval (window_start, window_stop), to remove the transient in that interval. Then the FFT is computed with the help of "fft" function.
For more information on the above-mentioned functions, you can refer to the following documentation:
For "rand" function:
For "hann" function:
For "fft" function:

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by