Академический Документы
Профессиональный Документы
Культура Документы
LAB MANUAL
Contents
Official Matlab Getting Started with Matlab Guide available in Digital Format
Official Matlab Getting Started with Matlab Guide available in Digital Format
What is Impulse?
S [n]= 1, if n=0
0, otherwise
S[n-n0] = 1, if n=0
0, otherwise
Problem 1:
(a) Implement a function for generating and plotting
x[n] = m[n n0] for a < n < b
Try it for
(i) n0= 5, m = 0.9, a = 1, b = 20
(ii) n0= 0. m = 0.8, a = -15, b = 15
(iii) n0= 333, m = 1.5, a= 300, b = 350
A [n 3l ]
l 0
l
Problem 2:
(a) A cosine wave is
x[n] = A cos(0 n +)
generate and plot
x1 [n] = sin ( n 1 7 ) 0n25
x2 [n] = sin ( n 1 7 ) -1 5 n 25
x3 [n] = sin ( 3 n + 2 ) -10n10
Nyquist Criterion
If the greater the number of samples the greater the accuracy, then why don't we sample at a very
high rate? There are two reasons for it. First of all high number of samples require a lot of
manipulation on behalf of the machine/software that we are using which results in more time.
Secondly most of the vital data that we need can easily be obtained from low sampling rates.
Therefore we need some criteria to define the rate at which the signals should be sampled. This
criteria is called as 'Nyquist Criteria'. According to it, the sampling frequency must (at least) be
twice the signal frequency. Consider the following figures
We can see that when the sampling rate doesnt satisfy the N.C, we dont get correct information
about the signal.
In time domain sampling can be represented by multiplication of the analogue signal with
impulse train, in which each impulse is separated by sampling time. Since Fourier transform of
an impulse train is an impulse train, in frequency domain it is equivalent of convolution of the
Fourier transform of the signal with another impulse train, which results in multiple copies of the
spectrum of the original signal. This process is shown in the figures (sampling frequency = 100
radians/sec):
Sampled Signal
It is clear from the figure that when sampling frequency is less than Nyquist rate, the repeating
spectrum of the sampled signals will overlap and aliasing will occurs. Therefore it is necessary to
band limit the signal before converting it to digital signal in order to avoid aliasing.
In order to reconstruct the signal we need to pass it through a low pass filter with cutoff
frequency fs/2. The results are shown in the following figure:
Lab Exercises:
Problem 1:
For all simulations take fsim = 80kHz
i) Generate a signal
Problem 2:
Convert the analogue signal to digital so that the samples are spaced by Ts. The ratio of fsim /fs =
1 (an integer).
i) Plot the resulting discrete time-signal with fs = 8 kHz
ii) Take its DTFT and plot it.
Problem 3:
Design a reconstruction filter
[b, a] = cheby2(9,60, fwt)
where
fwt= 2*(fs/2)* 1/fsim
use freqz to view its frequency response.
Problem 4:
Convert the digital signal to analogue signal using D/A conversion.
Insert zeros in between the digital signal to obtain an analogue output. Then apply chebyshev
filter to this output. Plot the resulting recovered signal and its Fourier transform.
Problem 5:
Try the entire procedure for fs = 8 kHz and f0= 2 kHz, 6 kHz, 7 kHz and 15 kHz.
FFT is an efficient algorithm of calculation of DFT. It requires much less computation, but it
requires the number of samples to be an integer power of 2. MATLAB provides FFT command
to compute DFT using FFT algorithm
Lab Exercises:
Problem 1:
i) Find 8 point DFT for the signal
xi= [10000000]
ii) xi=[11111111]
iii) Shifted impulse
xshift = [00010000]
iv) 3-point boxcar
xb = [11100000]
v) Symmetric boxcar
xbsy= [11000001]
Problem 2:
s[n] = A cos(27f0n + )
A=2 , = /4
i) Compute the 21-point DFT of s[n], Choose f0so that you have exactly 1 cycle Plot the
magnitude and phase,
ii) Repeat for a sine wave,
iii) Choose f0such that you have exactly3 cycles, (21-point DFT)
f0 1
8
iv) Choose and N=21 . What is the result ? if there is phase, why?
Problem 3:
6
0
N
i) and N=16 Compute DFT.
5
0
N
ii) and N=16 Compute DFT
Problem 5:
Repeat above problems using FFT and IFFT ( Choose number of samples accordingly)
Introduction
DFT
The FFT reduces considerably the computational requirements of the DFT. The DFT
of a discrete-time signal x(nT) is
where the sampling period T is implied in x(n) and N is the frame length. The
constants W are referred to as twiddle constants or factors, which represent the
phase, or and are a function of the length N.
Since this equation is in terms of a complex exponential, for each specific k there
are (N - 1) complex additions and N complex multiplications. This results in a total
of (N2 - N) complex additions and N2 complex multiplications. Hence, the
computational requirements of the DFT can be very intensive, especially for large
values of N. FFT reduces computational complexity from N2 to N logN.
The FFT algorithm takes advantage of the periodicity and symmetry of the twiddle
constants to reduce the computational requirements of the FFT.
For example, let k = 2, and note that W10 = W2, and from W6 = -W2.
X(k) becomes
Because (-1)k = 1 for even k and -1 for odd k ,above equation can be separated for
even and odd k, or
Substituting k = 2k for even k, and k = 2k + 1 for odd k, even and odd parts can
be written for k = 0, 1, . . . , (N/2) - 1 as
Figure 1 shows the decomposition of an N-point DFT into two (N/2)-point DFTs for
N = 8. As a result of the decomposition process, the Xs in Figure 1 are even in the
upper half and odd in the lower half. The decomposition process can now be
repeated such that each of the (N/2)-point DFTs is further decomposed into two
(N/4)-point DFTs, as shown in Figure 2, again using N = 8 to illustrate. The upper
section of the output sequence in Figure 1 yields the sequence X(0) and X(4) in
Figure 2, ordered as even. X(2) and X(6) from Figure 2 representthe odd values.
Similarly, the lower section of the output sequence in Figure 1 yields X(1) and X(5),
ordered as the even values, and X(3) and X(7) as the odd values. This scrambling is
Figure 2 Decomposition of a N Point DFT into four N/4 Point DFTs N=8.
and
Using W2N = WN/2 above equation can be expressed as two N/2 point DFTs.
Let
Equation needs to be interpreted for k > (N/2) - 1. Using the symmetry property of
the twiddle constant, W k+N/2 = -W k,
Figure 4 shows the decomposition of an eight-point DFT into two four-point DFTs
with the DIT procedure. This decomposition or decimation process is repeated so
that each four-point DFT is further decomposed into two two-point DFTs, as shown
in Figure 5. Since the last decomposition is (N/2) two-point DFTs, this is as far as
this process goes.
Figure 5 Decomposition of two four-point DFTs into four two-point DFTs using DIT.
With the changes, the same FFT flow graphs can be used for the IFFT.
Lab Exercises
Exercise 8.1: Implement a 128-point radix-2 FFT of a real-time input sinusoid with
a frequency of 3 kHz and an approximate amplitude of 2V p-p. Use a sampling
frequency of 16kHz. Obtain a plot of the output and explain the results. What is the
output frequency when the input signal frequency is 6kHz and 10kHz? Explain.
Exercise 8.2: Implement a 256-point radix FFT on real time audio input. Use TIs
optimized FFT function.
Lab7: Z Transform
Theory:
| z | = e T , z =T
With the definition of z = exp(sT), it can be easily seen that the magnitude of the complex
variable z is related to the real part of s (multiplied by T), and the phase of z is related to the
imaginary part of s (multiplied by T).
Therefore, the primary strip in the s-plane maps into the entire z-plane. The same complete
mapping occurs for any horizontal strip in the s-plane which has a Height of ws r/s. Therefore,
the s-plane maps into the z-plane an infinite number of times. Unique points in the s-plane will
map into the same point in the z-plane due to this relationship between s and z.
Now we will look at the z-plane. In the next figure, the unit circle is shown. The interior of that
circle corresponds to the left-half of the s-plane, the exterior corresponds to the right-half of the
s-plane, and the circle itself corresponds to the jw axis. Note that the two distinct frequencies in
the s-plane, \v\ and w2, have mapped into the same point in the z-plane, namely their phase
angles are equal and their magnitudes are both equal to 1. The mapping of the two frequencies
into the z-plane is shown in the equations.
z = esT=> e jT= e j2/s
z1 = ej0.2 = 0.8090+j0.5878
z1 = ej2.2 = 0.8090+j0.5878
| z 1| = | z 2| =1 , <z1 = <z2 = 36
Figure 1
Figure 2
n=-
X() = x[n] e-jn
n=-
Simply replace Z with ejw in Z-transform to get the frequency response.
Lab Exercises:
Problem 1:
i) H(z) = z-1
3-4z-1 + z -2
ii) ) H(z) = 1 + 0.42 z-1
1 0.8 2z-1 + 0.64z -2
a) Evaluate and plot the z-transform on unit circle, i.e. find H(ej) 0 2.
Gc= 10 Ac/20
a= ( 1- ) (1+ ); b= /(1+ )
Problem 1:
fs= 10000
Problem 2:
H(z) = b (1 - z-1 )
1 - az-1
Gc= 10 Ac/20
a= ( 1- ) (1+ ); b= /(1+ )
Problem 3:
For fs 10000 , fc = 1 kHz, Ac = 3 dB
i. Design a lowpass filter and plot frequency response,
ii. Design highpass filter and plot frequency response,
iii. Find and plot the sum of frequency responses of LP and HP filters.
= (1-GB2 / GB tan(/2)
GB = 10-AB/ 20
b= 1
1+
Find H(z) and plot its frequency response.
fs = 10kHz
= (1-GB2 / GB tan(/2)
b= 1
Problem 5:
Find H(z) and plot its frequency response.
fs = 10kHz
Problem 6:
For fs = 10kHz , f0 = 1.75kHz, f = 500 kHz, AB =3dB
a) Design a notch filter for above parameters and plot the frequency response.
b) Design a resonator filter for above parameters and plot the frequency response.
c) Add the frequency response of notch and resonator and plot it.
h(n) ha (nT )
2. Bilinear Transform
The bilinear transformation is a mathematical mapping of variables. In digital filtering, it is a
standard method of mapping the s or analog plane into the z or digital plane. It transforms analog
filters, designed using classical filter design techniques, into their discrete equivalents.
The bilinear transformation maps the s-plane into the z-plane by
21 z 1
s
T 1 z 1
Butterworth Filter
The Chebyshev type II filter minimizes the absolute difference between the ideal and actual
frequency response over the entire stopband, by incorporating an equal ripple of Rs dB in the
stopband. Passband response is maximally flat. The stopband does not approach zero as
quickly as the type I filter (and does not approach zero at all for even-valued n).
The absence of ripple in the passband, however, is often an important advantage.
Elliptic Filter
Elliptic filters are equiripple in both the passband and stopband. They generally meet filter
requirements with the lowest order of any supported filter type. Given a filter order n, passband
ripple Rp in decibels, and stopband ripple Rs in decibels, elliptic filters minimize
transition width.
2 1
H a ( j )
1 U N 2 ()
2
Lab Exercises:
Problem 2:
(fs=200)
Plot the DTFT of above signal
(ii) Remove the lowest frequency component of signal using all above mentioned filters. Use
freqz to plot the frequency response of filters used. Plot input and output signals.
(iii) Repeat part (ii) to remove intermediate frequency component
(iv) Repeat part (ii) to remove the highest frequency component
(Save the result as fig files, as u will be needing these results in next lab for comparison
(purpose)
Problem 3
Comment on the results obtained by using different filters(phase-linearity, transition bandwidth,
filter order requirement for achieving the same performance)
Theory
Frequency of an ideal low-pass filter is
H ( ) c c
= 1,
0, otherwise
Its impulse response is given by
h (n) c
= , k=0
sin( c k ) k
, otherwise
Causal FIR Filters can be obtained by
Truncating the impulse response of the ideal filter to make its length finite.
And shifting the truncated response to make it causal.
The process introduces phase delay (linear with frequency) and ripples in passband and
stopband. The reason behind this phenomenon can be explained by considering the truncation
operation as multiplication by a finite-length window sequence w [n] and by examining the
windowing process in the frequency domain. Thus, the FIR filter obtained by truncation can be
alternatively expressed as
h1 [n] hd [n].w[n]
From the modulation theorem, the Fourier transform of the above equation is given by
H t (e ) 1 / 2 H d (e j ) (e w ) d
jw
desired frequency response H (e ) with the Fourier transform. (e ) of the window. The
process is illustrated in the following figure with al! Fourier transforms shown as real functions
for convenience.
jw
From the last equation, it follows that if (e ) is a very narrow pulse centered at ~M<n<M
jw
d
(ideally a delta function) compared to variations in H (e ), then
jw jw
Ht (e ) will approximate Hd (e ),very closely. This implies that the length 2M + 1 of the
window function co[n] should be very large. On the other hand, the length 2M + 1 of ht[n] , and
hence that of w[n] , should be as small as possible to make the computational complexity of the
filtering process small.
1 2n
w[n] 1 cos
2 N 1 0 n N 1
b Hamming
2n
w[n] 0.54 0.46 cos
N 1 0 n N 1
c Blackman
2n 4n
w[n] 0.42 0.5 cos 0.08 cos
N 1 N 1 0 n N 1
d Kaiser
2 2
N 1 N 1
I a n
2 2
w[ n]
N 1
I a
2
Where
2
1 x k
I ( x) 1
k 1 k! 2
Relations among the frequency responses of an Ideal lowpass filter, a typical window, and
the windowed filter.
Since the corresponding impulse responses are symmetric with respect to n = 0, the frequency
responses are of zero-phase. From this figure, we observe that for the windowed filter,
H t (e jwc ) H t (e jwc ) 1 c H t (e jwc ) 0.5
, around the cutoff frequency w . As a result, .
Moreover, the passband and stopband ripples are the same. In addition, the distance between
locations of the maximum passband deviation and minimum stopband value is approximately
ML c
equal to the width of the main lobe of the window, with the center at w . The width of the
w wx w p ML
transition band, defined by , is less than . Therefore, to ensure a fast
transition from the passband to the stopband, the window should have a very small main lobe
width. On the other hand, to reduce the passband and stopband ripple , the area under the side
lobes should be very small. Unfortunately, these two requirements are contradictory
In the case of the window functions of above equations (Hann, Hamming, Blackman), the
value of the ripple does not depend on the filter length, or the cutoff frequency wc, and is
essentially constant. In addition, the transition bandwidth is approximately given by
w c
M
c
(Values shown in the table are for w =0.4 and M=128)
Decimation
Decimation is the process of reducing the sampling rate by an integer factor, M. In the discrete
time domain, decimation of a signal x by M is performed by discarding all but every M-th
sample of x. If we denote the decimated signal by xj, it follows that
x d ( K ) x( MK )
In other words only every M-th sample of the original signal is retained.
Suppose we have a sampled version of an analog signal which has a sampling rate which is too
high. This can arise for a number of reasons. For instance, the data may have been sampled by a
data acquisition system which has a fixed sampling rate. For reasons of data storage or real time
bandwidth requirements, it may be necessary to lower the sampling rate of the system. On
solution is to convert the signal back to analog and then resample at the new rate. Another
solution, which is much more practical, is to perform the sampling rate conversion in the
discrete time domain.
It is clear from the figure that frequency spectrum is expanded by M. Since effectively we are
reducing sampling rate, it is necessary to filter the signal before decimation with a cutoff
frequency of 7T/M, because the frequency components with frequency greater than 7T/M will cause
aliasing.
Interpolation
e
Given an interpolation rate which is an integer M, define the signal x (k) by
The resultant signal is derived from x(k) by zero-filling, which is also known as sampling rate
expanding.
The impact of zero-filling in frequency domain is compression of DTFT and filtering is required
to remove the high frequency components introduced due to compression of the spectrum, as
evident from the figure given below,
Clearly we can replace the two filters with a single filter, as shown in figure:
Problem 1:
1 (t ) 1
i. x
x 2 (t ) sin( 2 * 50 * t ) s 100
ii. (f )
b. Plot the signal and their DFTs. (use FFT and scale the x axis from 0 to 2)
c. Interpolate the signals (N=2). Repeat part b for the interpolated signals. Observe and
comment on the impact of interpolation in time domain and frequency domain
d. Construct filter for the interpolated signals. Filter the signals and observe the filtered
signals in both time and frequency domains
Problem 2:
b. Plot the signal and their DFTs. (use FFT and scale the x axis from 0 to 2)
c. Decimate the signals (N-2). Repeat part b for the decimated signals. Observe and comment
on the impact of decimation in time domain and frequency domain
d. Indicate the signal for which it is necessary to filter the signal before decimation
Problem 3:
X (z )
x( k ) z
k
k
Our end goal is to find a convenient expression for the Z-transform of 'x' when the sampling rate
is either increased or decreased by a factor of M. As a first step, we can break the signal into a
disjoint collection of elements whose indices are separated by M. To this end, rewrite X(z) as
X(z) =
x(0) x( M ) z M x(2M ) z 2 M
z 1 ( x (1) x ( M 1) z M x( 2 M 1) z 2 M )
z 2 ( x( 2) x ( M 2) z M x( 2 M 2) z 2 M )
z ( M 1) ( x( M 1) x(2 M 1) z 2 M x(3M 1) z 3 M )
We next proceed by factoring z~' from the i-th row of the above set of equations, which gives
X(z) =
x(0) x( M ) z M x(2M ) z 2 M
z 1 ( x (1) x ( M 1) z M x( 2 M 1) z 2 M )
z 2 ( x( 2) x ( M 2) z M x( 2 M 2) z 2 M )
x(kM i)( z
k
M
) k
The summation in the above equation is simply the Z-transform of the elements of 'x' which are
separated by M. If we define the polyphase component Pi(z)by
Pi(z) =
x(kM i)( z
k
M
) k
x(kM i)( z
k
M
) k
Z
k
-1
Pi (Z M )
This system consists of an FIR of length N followed by a decimator of rate M. the system only
needs to compute the output samples y(kM). Because the FIR precedes the decimator, however,
we require that N multiplications be performed during the clock cycle when y(kM) is being
computed in order to maintain real-time data flow. During the other clock cycles, the system is
idle. This is clearly a waste of computational resources. This problem can be rectified in and
elegant and simple manner using the polyphase decomposition.
Let H(z) be a rational transfer function. Consider the two systems in the following figure.
The first of these systems consists of s decimator of rate M followed by H(z). The second system
consists of H(zM) followed by a decimator of rate M. We can prove that these systems are
equivalent.
Clearly, the first system in the above figure is more efficient than the second. The transfer
function H(zM), although of higher degree than H(z), will have the same number of nonzero
coefficients as H(z). Thus, H(zM) requires the same number of multiplications per cycle as H(z).
Notice, however, that the data rate is much higher for the configuration in which filtering is
performed before decimation. If the filter is preceded by the decimator, the data arrives at the
filter at a data rate which is M times slower.
To see how this result can be used to derive an efficient structure for decimation, assume we wish
to filter by H(z) and then decimate by M. Hence, H(z) has a polyphase decomposition given by
Thus, one possible structure for the decimation/filtering system is given in the following
figure.
An equivalent structure can be built using the identity we just mentioned: filtering by HJ(ZM) then
decimating by M is equivalent to decimating by M then filtering by H i(z). Therefore, we can
replace the polyphase filters Hi (ZM) with the filters Hi (Z) and decimate after the filters, as shown in
figure shown below:
When H(z) is FIR of length N, the polyphase components will each have at most N/M nonzero
multiplications so that the new architecture will require total of (N/M)M = N multiplications per
output sample. However, the input to the filters arrives at 1/M the clock speed. Thus, the
computational complexity has been reduced by a factor of M.
According to the equation Xe(ej )=^X(ejM ), if the input to the sample-rate expander of the first
system is {x(k)}, the output of the expander has Z-transform X(z M). Thus, the output of the first
system has the Z-transform H(zM)X(zM). Examining the second system, the output of the filter is
H(z)X(z), and again according to the above equation, the output of the expander is given by
H(zM)X(zM). Therefore, the two systems are equivalent.
Consider the problem of implementing interpolation in practice. Our theoretical model was to
first expand the signal by M by zero-filling and then lowpass filtering at the increased sampling
rate T/M. If the lowpass filter is an FIR of length N, each output sample of the filter requires N
multiplications per T/M units of time. For even modest interpolation rates and FIR lengths, this
may not be possible using affordable (or even existing) hardware. Fortunately, the polyphase
representation can be used to lessen the computational complexity of the interpolator.
This model requires N multiplications per T/M seconds. Instead, the sampling rate expander can
be moved to the right of the polyphase. This is shown in the following figure:
In this network, each polyphase filter requires N/M multiplications per T seconds, for a total of N
multiplications per T seconds. This represents a reduction in complexity by a factor of M.
Lab Exercise
Repeat the problems of previous lab using polyphase filters.
Introduction
It is often desired to generate various types of waveforms, such as periodic square waves,
sawtooth signals, sinusoids, and so on. A filtering approach to generating such waveforms is to
design a filter H(z) whose impulse response h(n) is the waveform one wishes to generate. Then,
sending an impulse as input will generate the desired waveform at the output.
The above filtering approach can be used to generate a (causal) sinusoidal signal of frequency fo
and sampled at a rate fs. Denoting the digital frequency by
0 2f 0 fs
R sin 0 z 1
H ( z)
1 2 R cos o z 1 R 2 z 1
And,
h(n) = Rncos(
0 n )u ( n )
1 R cos 0 z 1
H ( z)
1 2 R cos o z 1 R 2 z 2
where the two frequencies uniquely define the key that was pressed. Following figure shows the
pairs of frequencies associated with each key.
The particular values of the 8 keypad frequencies have been chosen carefully so that they do not
interfere with speech. At the receiving end, the dual-tone signal y(n) must be processed to
determine which pair of frequencies is present. This can be accomplished either by filtering y(n)
through a bank of band pass filters tuned at the 8 possible DTMF frequencies or by computing the
DFT of y(n) and determining which pairs of frequency bins contain substantial energy.
Periodic Generators
b0 b1 z 1 b2 z 2 ... bD 1 z 1( D 1)
H ( z)
1 z D
Lab Exercises:
Problem 1:
i) Plot the impulse response of a sinusoidal generator with fo = 400 and fs= 8 kHz.
(length =400 samples)
ii) Cosinusoidal generator with f0 =800 and fs= 8 kHz (length = 400 samples)
Problem 2:
Implement a function dtmf-gen which should generate a DTMF for the digits 1-9
(length=2000 samples).
function[result, n] = dtmf(key);
Problem3:
Given the dtmf, write a function which should decode the dtmf to an appropriate key.
(Hint: Use dtft to detect ranges)
Range of f-30 Hz to f+30 Hz.
Problem4:
(i)
1 2 z 1 3z 2 4 z 3
H ( z)
1 z 4
1 2 z 1 3 z 2 4 z 3
H ( z)
1 0 .5 z 4
1 0.5 z 1 2 z 2 3z 3
H ( z)
1 z 3
This lab concerns with removing the additive noise out of the signal. If the noise is additive, then
the noised signal can be represented as;
where s[n] is signal and v[n] is noise. There are two possibilities:
i) When the frequency spectrum of the desired signal and noise do not overlap.
noise .spectrum
Signal
spectrum
ln E
eff
ln a a 1
as
First Order IIR Smoother (Low Pass)
b
H ( z)
1 az 1
1 a
NRR NRR aNRR 1 a
1 a
1 NRR
a
1 NRR
H ( z ) | w0 1 b 1 a
For
H ( z ) | w H ( 1) 1 b 1 a
for
1 a
NRR
1 a
b(1 z 1 )
H (z)
1 az 1
1 a 1 sin wc
b a
2 cos wc
and
Lab Exercises
Problem 1:
v[n]=0.2*randn(1,400)
Design a low pass IIR smoother. Input parameters are NRR. Apply this filter to x[n] to get y[] .
Plot y[n] , x[n]
s[n] = (-1) 5
x[n] = s[n] + v[n]
Wc
8
Problem 3:Use IIR smoother with cutoff frequency and x(n) same as Problem 1. Plot
y(n)
error
Algorithm
1) At time n, h(n) is available
2) Compute the filter output =h(n)yn
xn
Problem 1:
y = 0.1 * randn(1,200)
x=-0.8yn + yn
(a) = 0.3
(b) =0.1
(i) Implement the LMS ALGORITHM for a single co-efficient of h'. function [e,h] =
LMS(x8,y,mu)
(ii) Plot the error and the vector corresponding to the value of 'h' at every iteration.
2)
en xn x n
0mM
Problem 2:
You are given _y0[n]..y2 [n] Generate while Gaussian noises y0, y1 ,y2
x=-0.8y0 + 0.1y1 - 0.2y2
mu = 0.1
Code
e = zeros ( 1, length ( y0 ))
for i=0:length (yo)
x - hat = hQ(i)yo(i) + h1(i) y1 (i) + h2(i) y2 (i)
e(i) = x(i) x- hat
h0(i + 1) = h0 (i) +2 *
* e(i ) * y o (i )
h1(i + 1) = h1 (i) +2 *
* e(i ) * y1 (i )
h2(i + 1) = h2 (i) +2 *
* e(i ) * y 2 (i )
Vector Form
H(n+1) H(n) + 2 Y(n)
en
x-hat(i)=h*y-delay
e(i) =x(i) x-hat(i)
h=h+2
* e(i ) * y delay
end
h-un = rand(1,256)
y = randn(l,1000,3)
The purpose of this lab is to get the students acquainted with real time signal processing by
demonstrating implementation of different filters, by using custom-developed data acquisition
system and computer software.
implementation of notch filter, resonator, first order filters, second order filters
effect of phase non linearity and phase linearity on distortion ofthe filtered signal
Acknowledgement
CSE-304 DSP. Page 84
References