make it plot complex plane
This commit is contained in:
parent
0ec9cf1393
commit
b5b044a6e4
|
|
@ -34,4 +34,12 @@ freqz(b, a, 1024, samplingFreq);
|
||||||
title('Frequency Response of FIR Filter');
|
title('Frequency Response of FIR Filter');
|
||||||
grid on;
|
grid on;
|
||||||
|
|
||||||
|
% Plot impulse response
|
||||||
|
figure;
|
||||||
|
impz(b, a);
|
||||||
|
title('Impulse Response of FIR Filter');
|
||||||
|
xlabel('Samples (n)');
|
||||||
|
ylabel('Amplitude');
|
||||||
|
grid on;
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
6
main.m
6
main.m
|
|
@ -23,7 +23,11 @@ plotRawSignal(X, Fs);
|
||||||
[f, power] = frequencySpectrum(X, Fs, 1); % set 1 to plot
|
[f, power] = frequencySpectrum(X, Fs, 1); % set 1 to plot
|
||||||
|
|
||||||
% ======== Apply a bandpass filter ==============
|
% ======== Apply a bandpass filter ==============
|
||||||
[filteredSignal, Z, P] = iirFilter(10, [5 20], X, Fs, 1);
|
% [filteredSignal, Z, P] = iirFilter(10, [5 20], X, Fs, 1);
|
||||||
|
|
||||||
|
% ======== Apply FirFilter ===============
|
||||||
|
filteredSignal = firFilter(30, [5 20], X, 200); % for a 30th-order bandpass FIR filter
|
||||||
|
|
||||||
plotFilteredSignal(filteredSignal, Fs);
|
plotFilteredSignal(filteredSignal, Fs);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue