Azzera filtri
Azzera filtri

Impulse response and afr

2 visualizzazioni (ultimi 30 giorni)
ACICY
ACICY il 6 Giu 2020
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])

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by