How to plot average (mean) signal of 231 signals and plot the frequency response of that mean signal?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi all, I would like to plot an average signal of 231 signals in time domain and plot the frequency response graph. Here is my code and I would appreciate if somebody gives me any idea how to solve it.
signal = a; % acceleration
time=vt; % time
% Plot Original signal in Time Domain
subplot(211);
plot(vt,a(:,1:231,1)); % for sensor 1
title('Multiple signal in Time Domain(Healthy-Sensor1)');
xlabel('Time [s]');
ylabel('Acceleration [m/s^2]');
%FFT plot
Fs=32768; %Sampling frequency
N=2048;
y = fft(a(:,1:231,1),N)/length(signal);
Fn = Fs/2;
Fv = linspace(0, 1, fix(length(y)/2)+1)*Fn;
Iv = 1:length(Fv);
subplot(212);
plot(Fv,abs(y(Iv))*2);
title('FFT(Healthy-Sensor1)');
xlabel('Frequency [Hertz]');
ylabel('Magnitude');
댓글 수: 0
답변 (1개)
Image Analyst
2017년 7월 23일
I don't think you can use fft like this:
y = fft(a(:,1:231,1),N)/length(signal);
fft() is for 1-D signals, not 2-D signals or 3-D signals which is what a(:,1:231,1) is. I think you have to call mean() on one direction of the a signal, then fft that one 1-D mean signal. Please attach a and vt in a .mat file if you want more help.
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!