Anda di halaman 1dari 2

Nama : Nur Syahid

NPM : 2010631160119
PRETEST ESSAY
1. Tentukan impulse response filter menggunakan reactangular window dengan spesifikasi
berikut :
Jenis filter : low pass filter
Orde : 10
Fs : 20 kHz
Fc : 2,5 kHz

Jawab : untuk membuat desain filter menggunakan reactangular windor , disini dipakai fir
atau finite impulse response dengan program

% Impulse Filter Response using Rectangular Window

% Filter specifications
Fs = 20000; % Sampling frequency
Fc = 2500; % Cut-off frequency
N = 10; % Filter order

% Create the filter


h = fir1(N, Fc/(Fs/2), 'low', rectwin(N+1));

% Generate the impulse signal


impulse = [1 zeros(1, N)];

% Apply the filter to the impulse signal


filtered_impulse = filter(h, 1, impulse);

% Plotting
subplot(2,1,1);
stem(0:N, h);
xlabel('Sample');
ylabel('Filter Coefficient');
title('Impulse Filter Coefficients');

subplot(2,1,2);
stem(0:N, filtered_impulse);
xlabel('Sample');
ylabel('Amplitude');
title('Impulse Filter Response');

maka akan terbentuk sebuah impuls response sebagai berikut :


2. Buatlah desain filter iir chebysev High pass filter dengan spesifikasi
Fs = 1000;
Fstop = 300;
Fpass = 400;
Rs = 10 dB
Ripple stopband (dB) Rp = 3Db
Jawab : untuk membuanya menggunakan kode
% Spesifikasi filter
Fs = 1000; % Frekuensi sampling
Fstop = 50; % Frekuensi stopband
Fpass = 100; % Frekuensi passband
Rs = 60; % Ripple stopband (dB)
Rp = 1; % Ripple passband (dB)

% Menghitung parameter filter


Wstop = 2*Fstop/Fs; % Frekuensi stopband dalam domain digital
Wpass = 2*Fpass/Fs; % Frekuensi passband dalam domain digital
[n, Ws] = cheb1ord(Wpass, Wstop, Rp, Rs); % Menghitung order dan frekuensi stopband
[b, a] = cheby1(n, Rp, Ws, 'high'); % Merancang filter Chebyshev

% Menampilkan respons frekuensi filter


freqz(b, a, 1024, Fs);
dengan hasil hitungnya adalah

Anda mungkin juga menyukai