Question

1. Write a MATLAB function to determine the discrete-time Fourier Transform (H(?)) of the following sequence. Plot its magnitude and phase. You can use the dtft command and use the abs, angle and plot commands to plot the results.

x(n) = {4, 3, 2, 1, 2, 3, 4}.

2. Analytically determine H(z) and plot its magnitude and phase for the following system using freqz.

y(n) = 2x(n) + x(n ? 1) ? 0.25y(n ? 1) + 0.25y(n ? 2).

3. By using the “fvtool” command you can see the magnitude and phase response of H(?), the zero-pole locations, impulse response, stability of the system and much more. (Note that the magnitude is in dB which is OK). Note that the “freqz” function will also return the magnitude and phase of H(?) when the parameters of H(z) are given but additional commands are needed for plotting the values. Plot the following using “fvtool”.

a) Assume that H(z) has a pole at z = 0.7 and a zero at z = a. Plot the magnitude and phase response of H(?) for all the following cases of a = -3, -1,-0.5, 0.65, 0.7, 0.8, 1, 1.5, 3. This will show the effect of the location of the zero on the frequency response. Explain what you have observed.

b) Assume H(z) has to zeros at ej?/4 and e-j?/4 and two poles both at z = c. Analytically find H(z) and use Matlab to show the changes in |H(?)| for c = -0.9, -0.2, 0.2, 0.7, 0.95. Show the zero-pole plot for each case as well and explain the effect of the location of the double poles on the filter type.

Answer #1

matlab code for min_dft.m

x = [4 3 2 1 2 3 4];

n = 0:length(x)-1;

w = 2*pi*(0:0.001:length(x)-1)/length(x);

X = dfft(x,n,w);

subplot(2,1,1)

plot(w,abs(X))

xlabel 'w (rad / sec)'

ylabel 'Amplitude'

grid on

subplot(2,1,2)

plot(w,angle(X))

xlabel 'w (rad / sec)'

ylabel 'Phase'

grid on

--------------------------

code for dfft.m

function [ X ] = dfft( x, n, w )

%UNTITLED Summary of this function goes here

% Detailed explanation goes here

X = x*exp(-j*n'*w);

end

-------------------------------------------

System 3 : Consider the discrete time system represented by the
following difference equation:
y(n) ? x(n) ? x(n ? 2) ? 0.8y(n ?1) ? 0.64 y(n ? 2)
a) Draw the corresponding BLOCK DIAGRAM
b) Obtain the TRANSFER FUNCTION, H(z) , for this
system.
c) Calculate and plot the POLES and ZEROS of the transfer
function.
d) State the FREQUENCY RESPONSE Equation , H(ej? ) ,
for this system.
System 4 : Consider the discrete time system represented by...

7. Optimal Lowpass Filter. Use the MATLAB command h = firpm(28,
[0 0.30 0.36 1], [1 1 0 0]) to design an optimal lowpass filter
with length 29, passband from 0 to wp = 0.30pi and a stopband from
ws = 0.36pi to pi with a desired response of 1 in the passband and
zero in the stopband. (Assume equal error weighting in both the
passband and stopband for the optimal filter in all exercises
except Exercise 11.) Plot the...

Problem 1....... you can use Matlab
The following Scilab code generates a 10-second “chirp” with
discrete frequencies ranging from 0 to 0.2 with a sampling
frequency of 8 kHz.
clear;
Fs = 8000;
Nbits = 16;
tMax = 10;
N = Fs*tMax+1;
f = linspace(0.0,0.2,N);
x = zeros(f);
phi = 0;
for n=0:N-1 x(n+1) = 0.8*sin(phi);
phi = phi+2*%pi*f(n+1);
end sound(x,Fs,Nbits);
sleep(10000); //allows full sound to play
Add code that calculates and plays y (n)=h(n)?x (n) where h(n)
is the...

2. Consider the following impulse responses h[n] of linear
time-invariant (LTI) systems. In each case,
(i) provide the transfer function H(z) (ZT of h[n]) and its
ROCh,
(ii) sketch the ROCh in the z-plane,
(iii) mark the pole and zero locations of H(z) (on the same plot
in the z-plane), and (iv) discuss whether or not the LTI system is
stable.
(a) h1[n] = (0.4)^n u[n] + (2 - 3j)^n u(n -2)
(b) h2[n] = (0.2)^(n+2) u[n] + (2 -...

Write and upload a
MATLAB script to do the following.
Compute the sequence
S(n+1) = (2 – K) S(n) – S(n-1) ; Assume S(1) = 0, S(2)
= 1;
(a)
Case 1, Assume K = 1
(b)
Case 2, Assume K = 2
(c) Case 3, Assume K = 4
Plot all of these on
the same plot, for N = 1 to 20

For the LTI system described by the following system functions,
determine (i) the impulse response (ii) the difference equation
representation (iii) the pole-zero plot, and (iv) the steady state
output y(n) if the input is x[n] = 3cos(πn/3)u[n].
a. H(z) = (z+1)/(z-0.5), causal system (Hint: you need to
express H(z) in z-1 to find the difference equation )
b. H(z) = (1 + z-1+ z-2)/(1-1.7z-1+0.6z-2), stable system
c. Is the system given in (a) stable? Is the system given in...

Problem 1
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...

Problem 3 you can use Matlab and also i give u the Problem 1
code its on Matlab
Using the same initial code fragment as in Problem 1, add code
that calculates and plays y (n)=h(n)?x (n) where h(n) is the
impulse response of an IIR bandpass filter with band edge
frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth
prototype. Name your program p3.sce
this is the Problem 1 code and the solutin
clear; clc;...

Curve-Fit Function USING MATLAB
Using the top-down design approach, develop a MATLAB function
A8P2RAlastname.m that reads data from a file and performs
regression analysis using polyfit and polyval. The function shall
have the following features:
The input arguments shall include the file name (string), a
vector of integers for the degrees of polynomial fits to be
determined, and an optional plot type specifier (‘m’ for multiple
plots, ‘s’ for a single plot - default).
The data files will be text...

Problem 1 ...... you can use Matlan i got one so all
what i need is 2, 3 and 4 one of them or all of them ..
thanks
The following Scilab code generates a 10-second “chirp” with
discrete frequencies ranging from 0 to 0.2 with a sampling
frequency of 8 kHz.
clear; Fs = 8000;
Nbits = 16;
tMax = 10;
N = Fs*tMax+1;
f = linspace(0.0,0.2,N);
x = zeros(f);
phi = 0;
for n=0:N-1 x(n+1) = 0.8*sin(phi);
phi...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 1 minute ago

asked 13 minutes ago

asked 21 minutes ago

asked 28 minutes ago

asked 28 minutes ago

asked 34 minutes ago

asked 37 minutes ago

asked 47 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 2 hours ago