Digital Signal Processing Reference
In-Depth Information
A9.12
Überlegen Sie, welchen Vorteil die lineare Phase bei der Filterung von Signalen hat.
A9.13
Im Versuch sollen Sie Ihre Ergebnisse aus der Vorbereitung mit MATLAB verifi-
zieren. Machen Sie sich dazu mit dem Programmbeispiel 9-1 vertraut. Es gibt das
Pol-Nullstellendiagramm und die Frequenzgänge des Betrags, der Phase und der
Gruppenlaufzeit zu einer Impulsantwort endlicher Dauer aus.
Mit der MATLAB-Function
firplot([1 2 3 3 2],'test')
wurde die
Anzeige in Bild 9-6 erzeugt.
Machen Sie sich mit den MATLAB-Befehlen
roots
,
zplane
,
unwrap
und
grpdelay
vertraut.
Programmbeispiel 9-1
Grafische Darstellung des Pol-Nullstellendiagramms, der Impulsantwort, der
Frequenzgänge des Betrags, der Phase und der Gruppenlaufzeit und der
Dämpfung von FIR Systemen
function firplot(h,txt)
% Pole-zero plot and plot of the magnitude, the attenuation,
% the phase and the group delay of a FIR system
% function firplot(h,txt)
% h : impulse response of FIR system
% txt : text string for figure title
% mw * 11Nov2010
if nargin==2
NAME = [
'firplot : '
,txt];
%
add text to the figure title
else
NAME =
'firplot'
;
end
FIG = figure(
'Name'
,NAME,
'NumberTitle'
,
'off'
);
%
Impulse response
subplot(3,2,1), stem(0:length(h)-1,h,
'filled'
), grid
xlabel(
'{\itn} \rightarrow'
), ylabel(
'{\ith}[{\itn}] \rightarrow'
)
%
Pz-plot
subplot(3,2,2), zplane(h,[1 zeros(1,length(h)-1)]), grid
xlabel(
'Re \rightarrow'
), ylabel(
'Im \rightarrow'
)
%
Magnitude of frequency response
N = 1024;
%
number of samples in the frequency domain
H = fft(h,max(N,length(h)));
f = 0:N-1; f = 2*f/N;
f = f(1:N/2); H = H(1:N/2);
subplot(3,2,4), plot(f,abs(H)), grid
xlabel(
'\Omega / {\it\pi} \rightarrow'
)
ylabel(
'| {\itH}(e^{j\Omega}) | \rightarrow'
)
%
Attenuation of frequency response
subplot(3,2,6), plot(f,min(-20*log10(abs(H)),100)), grid
xlabel(
'\Omega / {\it\pi} \rightarrow'
)
ylabel(
'{\ita}(\Omega) in dB \rightarrow'
)
%
Phase of frequency response
subplot(3,2,3), plot(f,angle(H)/pi), grid
xlabel(
'\Omega / {\it\pi} \rightarrow'
)
ylabel(
'{\itb}(\Omega) / {\it\pi} \rightarrow'
)
%
Group delay
[tau,w] = grpdelay(h,[1 zeros(1,length(h)-1)],N,
'whole'
);