Question

In: Electrical Engineering

Consider the discrete-time filter defined by h = fir1(40,0.2). The coefficients h represent a 40th order...

Consider the discrete-time filter defined by h = fir1(40,0.2). The coefficients h represent a 40th order filter, with a corner frequency of 0.2 times the Nyquist frequency. Use Matlab help on fir1 to learn more about this command. Plot the frequency response of the filter h using the command freqz. Include this plot in your report.

Solutions

Expert Solution

clc
clear all
close all
N=40; %Order
Fs=0.2; %Nyquist frequency
%fir1(h,wn) creates a window based linear-Phase FIR digital filter design.
h=fir1(N,Fs);
freqz(h) %frequency response
hold on
subplot(2,1,1)
title('Frequency Response')
subplot(2,1,2)
title('Phase Response')

The response is a Low pass filter response. i.e fir1 by default takes a lowpass filter response.

To perform high pass filter we have to mention high in fir1 function

%---------------High pass filter---------------------

clc
clear all
close all
N=40; %Order
Fs=0.2; %Nyquist frequency
%fir1(h,wn) creates a window based linear-Phase FIR digital filter design.
h=fir1(N,Fs,'high'); %high pass filter
freqz(h) %frequency response
hold on
subplot(2,1,1)
title('Frequency Response')
subplot(2,1,2)
title('Phase Response')

similarly we can perform remaining filter by including proper parameters in fir1

Please leave feedback


Related Solutions

The filter coefficients of a second-order digital IIR filter are: a0 = 1, a1 = -2,...
The filter coefficients of a second-order digital IIR filter are: a0 = 1, a1 = -2, a2 = 2, b0 = 1, b1 = 1/2, b2 = 1/8. (a's are numerator coefficents and b's are the denominator coefficients). Compute the magnitude response |H(ej?)| where ? = 2.721 rad/sec.
Kinetics "Explain why you think that the stoichiometric coefficients do not represent the order of the...
Kinetics "Explain why you think that the stoichiometric coefficients do not represent the order of the reactants in a chemical reaction?"
1. We want to design a discrete-time bandpass filter that samples and processes analog signals. The...
1. We want to design a discrete-time bandpass filter that samples and processes analog signals. The frequency response is 0 at 0 Hz and 500 Hz, and resonant occurs at 125 Hz. The sampling interval T= 1 msec. Find the transfer function H[z] of these filters and mark the poles and zeros on the complex plane.
Q1.Consider an inventory system in discrete time with the following description. At the beginning of the...
Q1.Consider an inventory system in discrete time with the following description. At the beginning of the period the inventory decreases by one unit if the inventory level at the beginning is positive other the level remains zero till the end of the period. At the end of the period nth period, the inventory is increased by an amount Vn, where {Vn|n ≥ 1} is i.i.d. with P{V1 = i} = pi , i ≥ 0. Let Xn denote the level...
Q1.Consider an inventory system in discrete time with the following description. At the beginning of the...
Q1.Consider an inventory system in discrete time with the following description. At the beginning of the period the inventory decreases by one unit if the inventory level at the beginning is positive other the level remains zero till the end of the period. At the end of the period nth period, the inventory is increased by an amount Vn, where {Vn|n ≥ 1} is i.i.d. with P{V1 = i} = pi , i ≥ 0. Let Xn denote the level...
1. A length-10 discrete-time signal x[n] is defined by the values { 6, 1, 1, 6,...
1. A length-10 discrete-time signal x[n] is defined by the values { 6, 1, 1, 6, 1, 1, 6, 1, 1, 0 }. After taking the 10-pt DFT, X[k], determine the DC value, i.e., X[0]. 2. Suppose that the N-point DFT of the signal x[n]x[n] is X[k]. A new signal y[n] is formed by adding a constant: y[n]=x[n]+1 for n=0,1,2,…,N−1n=0,1,2,…,N−1 The N-point DFT of Y[k] is:
1. Design 3rd order ideal low pass filter H(s). Two poles are complex conjugates, and one...
1. Design 3rd order ideal low pass filter H(s). Two poles are complex conjugates, and one pole is on the real axis. 2. transform H(s) to H(z). (Use impulse invariance criterion) 1%criterion
Consider the Hamiltonian of a particle in one-dimensional problem defined by: H = 1 2m P...
Consider the Hamiltonian of a particle in one-dimensional problem defined by: H = 1 2m P 2 + V (X) where X and P are the position and linear momentum operators, and they satisfy the commutation relation: [X, P] = i¯h The eigenvectors of H are denoted by |φn >; where n is a discrete index H|φn >= En|φn > (a) Show that < φn|P|φm >= α < φn|X|φm > and find α. Hint: Consider the commutator [X, H] (b)...
Compute the unit-­pulse response h[n] for the discrete-­time system y[n + 2] - 2y[n + 1]...
Compute the unit-­pulse response h[n] for the discrete-­time system y[n + 2] - 2y[n + 1] + y[n] = x[n] (for n = 0, 1, 2, 3)
#1. Represent the function: e(t)=5sin31.4t+2sin44t+6sin15.74t+2sin37.68t as a discrete set of N=128 numbers seperated by a time...
#1. Represent the function: e(t)=5sin31.4t+2sin44t+6sin15.74t+2sin37.68t as a discrete set of N=128 numbers seperated by a time increment of (1/N). Using MatLab construct an amplitude spectrum from the data set. #2. Repeat problem #1 using a data set of 256 numbers at sigma(t)=(1/N) and sigma(t)=(1/2N) seconds. Please show the full code used in matlab to solve the problems.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT