FFT analysis of multiple signals with the same response length

9 次查看(过去 30 天)
I have a dataset of the responses of a dynamic system in a time- domain. The signal is 1 second long and sampling frequency is 2000 Hz. I have 100 of different system configurations, meaning that my dataset has the shape of 2000x101, where the column 1 represents time and the rest columns are reponses of the system. How to perform FFT analysis for each signal and save obtained signals in frequency- domain to the new dataset? By this moment I can perform FFT only for 1 signal, the code is below. Obviously, for loop is need for this operation, but I don't have much experience to implement it for this problem.
%load data
Data = Data4FFT(:,2);
Time1= Data4FFT(:,1);
L = numel(Data);
Fs = 2000;
Fn = Fs/2;
Ts = 1/Fs;
t = linspace(0, L, L)*Ts;
FTS = fft(Data)/L;
FvHz = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fvrs);
figure(2)
plot(FvHz, abs(FTS(Iv))*2)
grid
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Response in Frequency Domain')

采纳的回答

Star Strider
Star Strider 2020-1-23
The fft function operates column-wise (unless the argument is a vector or you tell it otherwise), so this is all that is necessary:
Data4FFT = [((0:1999).'*5E-4), rand(2000,100)]; % Create Matrix
L = size(Data4FFT,1); % Signal Length
t = Data4FFT(:,1); % ‘... first column is time ...’
Data = Data4FFT(:,2:end);
Fs = 2000;
Fn = Fs/2;
Ts = 1/Fs;
FTS = fft(Data - mean(Data))/L; % Subtract Mean To Eliminate D-C Offset
FvHz = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(FvHz);
figure(2)
plot(FvHz, abs(FTS(Iv))*2)
grid
xlabel('Frequency (Hz)')
ylabel('Amplitude')
title('Response in Frequency Domain')
You might want to plot the fft results individually, display the mean of all of them, or use the ribbon function to see them all at once.
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by