You are on page 1of 5

Introduction

In this lab we were supposed to learn about DSP system and here we specifically learn about the DSP process. The DSP system is shown below. Band-limited Input Signal Analog to Digital Converter DSP Process Analog Lowpass Filter Op

In the DSP process we consider, is a system described by the below difference equation. y[n] = 1.8971*y[n-1] - 0.9948y[n-2] + 0.997*x[n] 1.8971*x[n-1] + 0.9974*x[n-2] This can be represented in the Z transform by the below equation H(z) = Y(z)/X(z) = (0.9974 1.8971*z-1 + 0.9974*z-2)/(1 1.8971z-1 + 0.9948*z-2) Here z = e = e here t is the periodic time of the sampling frequency and = 2f f is the frequency that we consider. Below is the hardware implementation of the above DSP process
jt st

In the above diagram the crosses are multipliers and the boxes with T are the delay generators and the circles with positive sign are the adders. Activity 1 We were supposed to write a MATLAB program for the above DSP process to obtain the frequency response of the system so we had to arrange the equation as shown below by replacing z-1 by e-jt where = 2t.

H = (0.9974-1.8971*e-j2ft+0.9974*e-4jft)/(1-1.8971*e-2jft+0.9948*e-4jft)
In the MATLAB program t=0.001 since the sampling frequency is 1kHz
t=0.001; f = -500:0.01:500; H = (0.9974-1.8971*exp(-j*2*pi*f*t)+0.9974*exp(-2*j*2*pi*f*t))./(11.8971*exp(-j*2*pi*f*t)+0.9948*exp(-2*j*2*pi*f*t));

figure(1) plot(f,abs(H)); figure(2) plot(f,angle(H));

In the above diagram we plot the frequency and the phase response of the system here since it is frequency we plot the two graphs for separate frequencies. Below shows the output.

Frequncy Response

Phase Response

From these two diagrams we can say that this system acts as a digital filter (A low pass filter)

Activity 2 Here we drew the above system using the MATLAB Simulink function and below is the diagram.

In the above diagram we supply 2 sinusoidal waveforms keeping one waveform as the reference where the amplitudes of the both are the same. Then we sample it using the sampling frequency 1kHz(Supplied from the Pulse Generator) and hold it in the Sample and Hold after sampling then the sampled wave is fed to the digital filter where it filters the signal digitally with the properties given by the transfer function assigned to Discrete Transfer Fcn (TF). Here in order to give the TF we should assign it as below. Though we have z-1 in the original equation here we have z. Made by taking z-2 as a common factor from the both equations. sample time should be 0.001 since sampling frequency is 1kHz.

Then this wave will be passed through the Analog Filter Design and we can see the output. We must give the maximum possible frequency in the waveform here it is 500Hz. Below is the information gained from the above system. From the below table we can see that when increasing the input wave frequency the amplitude get a bit reduced and the frequency becomes almost equal. Here in the above we must choose the filter type to besself. The first wave is shown below(for 10Hz).

Frequency of arbitrary sinusoid f (Hz) 10 30 40 45 55

Amplitude of the Output 1 1 1 1 1

Frequency of the Output 7Hz 20Hz 33Hz 35Hz About 55Hz

Remarks f is slightly reduced but same amplitude f is slightly reduced but same amplitude f is slightly reduced but same amplitude f is slightly reduced but same amplitude f is approximately equal to input but same amplitude f is approximately equal to input and amplitude a bit reduced

100

About 100Hz

200

About 200Hz

300

About 300Hz

f is approximately equal to input and amplitude reduced f is approximately equal to input and amplitude reduced

Activity 3 Here we had to write a MATLAB program for the above DSP filter and it is shown below.
w1=0; w2=0; w3=0; X=0; n = input('n');%enter how many times you want for(i=1:n) X=input('x'); w1 = X+1.8971*w2-0.9948*w3; y = 0.9924*w1-1.8971*w2+0.9974*w3; y w2=w1; w3=w1; end

In the above program we calculate y for different inputs and get the corresponding output. Here it is possible to enter the number of inputs and enter the values we want and get the corresponding output. Discussion In the activity 2 when giving frequencies we have to give in rad/sec, so if 10Hz then frequency is 20 since = 2f. In this lab we considered a DSP process.

You might also like