what type of signal is this?FIR filters

2 次查看(过去 30 天)
i am confused as to what type of signal this is when the matlab code is written.
here's ,my code, the variables are linked.
input = xx;
T = 2001;
N = length(t);
freq = abs(fft(input))*2/N;
f = (0:N-1)'/T;
subplot(2,2,1);
plot(input, 'b*-'); % Plot the input as a blue line
xlabel('Time/s');
ylabel('Amplitude');
subplot(2,2,2);
plot(f,freq);
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
xlim([0 0.5]);

采纳的回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020-11-27
Here is the corrected code. Time domain vs. Frequency domain analysis of the signal t vs. xx:
load firlab2
%%
input = xx;
dt = t(2)-t(1); % Sampling time, [s]
fs = 1/dt; % Sampling frequency, [Hz]
N = length(t); % Signal length
F = abs(fft(input))/N; % Signal spectrum
F1 = F(1:N/2+1);
F1(2:end-1) = 2*F1(2:end-1);
f = fs*(0:(N/2))/N; % Frequency data
subplot(211)
plot(t, input, 'b-') % Input signal in Time domain
xlabel('\it Time, [s]')
ylabel('\it Amplitude')
title 'Signal in time domain'
grid on
subplot(212)
plot(f,F1) % Input signal spectrum in frequency domain
title('Single-Sided Amplitude Spectrum of Signal ')
xlabel('\it Frequency, [Hz]')
ylabel('\it Amplitude of Spectrum')
grid on
  1 个评论
Tianchu Lu
Tianchu Lu 2020-11-27
yeah thanks,would you know what type of signal this is? after its gone through some kinda of filter?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multibody Dynamics 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by