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. 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)...
#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.
Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1)...
Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1) Determine the fundamental period of x[n]. (2) Suppose x[n] is obtained by sampling the continuous-time signal  x ( t )   =   cos   ( πt ), by letting the sampling period to be T s =   0 . 7 and considering the sample values at each n. Is the Nyquist sampling conditions satisfied in this case? Explain and relate this to the answer given before. (3) Under that conditions would...
Consider the discrete-time LTI system characterized by the following difference equation with input and initial conditions specified
  Consider the discrete-time LTI system characterized by the following difference equation with input and initial conditions specified: y[n] - 2 y[n-1] – 3 y[n-2] = x[n] , with y[0] = -1 and y[1] = 0, x[n] = (-1/2)n u[n-2]. ? Write a MATLAB program to simulate this difference equation. You may try the commands ‘filter’ or ‘filtic’ or create a loop to compute the values recursively. ? Printout and plot the values of the input signal, x[n] and the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT