Impulse response and afr

2 次查看(过去 30 天)
ACICY
ACICY 2020-6-6
Hello, i need help at two graphic both in x axis how to put time in impulse response like in first image and at AFR graphic put that frequency like in first image. First image:
Second image what i have:
Code:clc
N=512; %Number samples
Fd=40e3; %Smpling frequency
f1=700; %Frequencies of signal components
f2=14000;
%Filtr parametres
A=[1.000000 -2.782514 3.966808 -3.405150 1.875863 -0.650946 0.130852 -0.011663];
B=[0.00096289 0.00674026 0.02022078 0.03370129 0.03370129 0.02022078 0.00674026 0.00096289];
%Discrete time samples
n=0:N-1
%Generate discrete delta functiom a single pulse
u=[1 zeros(1,N-1)];
%Calculate impulse response
h=filter(B,A,u) %Impulse reaction determination
H=freqz(B,A,n/(N-1)*pi,14000); %AFR(Amplitude frequency curve)
%AFR
figure(1),subplot(211), plot(abs(fft(h)/N))
%Impulse response
subplot(212), plot(h)
title('Impulse response')
xlabel('Time, sec'); ylabel('Impulse response');
xlim([0 200])

回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by