Professional Documents
Culture Documents
Title of Assignment
Write a C program to generate samples of sine, square, exponential & random
1.
signals at specified sampling frequency and signal parameters.
2. Find the output of a given system for given input sequence using linear convolution.
Find the output of a given system described by given difference equation & initial
3.
conditions for given input sequence.
4. Find circular convolution of a given two sequences
Write a program to accept pole zero location to generate pole zero plot, all possible
5.
ROC’s.
6. Write a program to plot the magnitude & phase response of a given system.
7. Find N pt DFT/IDFT of given complex sequence x (n)/x (k).
8. Compute circular convolution using DFT/IDFT.
9. Implement 8 pt Radix-2 DIT FFT algorithm
10. Find DFT using Goertzel algorithm.
Find the Fourier Transform of various windows functions; plot the magnitude &
11.
phase functions.
Design a DT IIR Butterworth filter for given specifications using bilinear
12.
transformation.
13 Study of ADSP 21xx Series DSP Processor
Assignment No.1
Title of Assignment:
Write a C program to generate samples of sine, cos, square, exponential &
Random signals as specified sampling frequency & signal parameters.
Signal: A signal is the entity that carries information. Signal can be electric or non-
electric. Electric signal carry information with electric current. Non-electric signals are
sound waves that carry information with air pressure.
Where X(n) is the discrete time signal obtained by taking samples of the analog signal
Xa(t) at every T seconds. The time interval T between successive samples is called the
sampling period or sampling interval & it’s reciprocal 1/T = Fs is called as sampling
frequency (Hz).
Periodic sampling establishes a relationship between the time variable t & n of
continuous time & discrete time signals respectively. These variables are linearly related
through the sampling period T or equivalently through the sampling rate Fs=1/T as
t=nT=n/Fs. -------1
Comparing equation 3 & 1 we note that the frequency variable F & f are linearly
related as
f=F/Fs -------4
Example:
Consider the analog signal
Xa(t)=3cos 100π t
Solution:
b. If the signal is sampled at rate Fs = 200 Hz what is the discrete time signal
is
X(n) = 3 cos 100π n/200 = 3 cos π n/2
ya(t) = 3cos 2π f * t
3cos 50π t
Algorithm:
1. Display the menu on screen & prompt the user to enter which wave to be displayed.
2. To display sine wave use the amplitude, frequency, sampling frequency & the shift
given by the user & using formula Amp*sin(2 π ft) draw the sampled sin wave.
3. To display shifted wave use Amp*sin(2π Ft+φ ) where φ is shift value.
4. Similarly for cos wave repeat step 2 only formula will be Amp*cos(2π ft) & draw the
cos wave.
5. To display Exponential wave use Exp function & draw exponential wave.
6. To display Random wave use rand function & draw random wave.
7. To display square wave assume arbitrary sampling rate & display square wave.
Testing:
Input:
Amplitude, frequency, Sampling frequency of the wave to be generated.
Output:
Sin wave, cos wave, exponential wave, random wave& square wave.
Conclusion:
In this way we can generate samples of sine, cos, square, exponential &
Random signals.
Assignment No. 2
Title of Assignment:
Find the output of a given system for a given input using their linear Convolution.
Where n is the time index & k is the parameter showing location of input pulse. If the
impulse at the input is scaled by an amount Ck=x(k) then response of the system is
correspondingly scaled output i.e.
Ckh(n, k)=x(k)*h(n, k)
If the input is the arbitrary signal x(n) i.e. represented as sum of weighted impulse i.e.
∞
x(n)=Σ x(k)* δ (n, k)
k=-∞
then the response of system to x(n) is the corresponding sum of weighted outputs i.e.
∞
y(n)=T[x(n)]=T[ Σ x(k)* δ (n, k)
k=-∞
=T[….+x(-2)* δ (n+2)+x(-1)* δ (n+1)+x(0)* δ (1)+x(1)* δ (n-
1)+-----]
as output of system is linear
=T{ x(-2)* δ (n+2)}+T{ x(-1)* δ (n+1)}+T{ x(0)* δ (1)}+-----
∞
= Σ x(k)* T[δ (n, k)]
k=-∞
∞
y(n)= Σ x(k)* h(n-k)
k=-∞
Properties of Convolution:
1.Commutative:
Convolution satisfies commutative property
Y(n)=x(n)*h(n)=h(n)*x(n)
i.e. ∞
y(n)= Σ x(k)* h(n-k)
k=-∞
∞
y(n)= Σ h(n-k)*x(k)
k=-∞
Are same
2.Associative:
[x(n)*h1(n)]*h2(n)=x(n)*[h1(n)*h2(n)]
3.Distributive:
x(n)*[h1(n)+h2(n)]=x(n)*h1(n)+x9n)*h2(n)
That means two LTI systems connected in parallel can be replaced by a single
system with h(n)=h1(n)+h2(n)
4.Casuality:
System is said to be casual if it’s output at time n depends only on present &
past inputs.
∞
y(n)= Σ h(n-k)*x(k)
k=-∞
We can divide the sum into two sets one having present & other having future values of
input.
∞ -1
= y(n)= Σ h(n-k)*x(k) + y(n)= Σ h(n-k)*x(k)
k=0 k=-∞
y(n)=[x(0)*h(n)+x(1)*h(n-1)+x(2)*h(n-3)+-----+x(-2)*h(n+2)+---]
h(n)=T[δ (n)]
h(n)=0 n<0
LTI system is casual if and only if it’s impulse response is zero for negative values.
5. System is BIBO (bounded input bounded output) if and only if it’s output sequence
y(n) is bounded for every bounded input x(n).
Example:
Obtain linear Convolution of the following two sequences
x(n)={1,2,3,1} , h(n)={1,2,1,-1}
↑ ↑
∞
y(n)= Σ x(k)* h(n-k)
k=-∞
we can write as
x(k)={1,2,3,1} , h(k)={1,2,1,-1}
↑ ↑
therefore
5
n=-1 y(-1)= Σ x(k)*h(-1-k)
k=-1
=x(0)*h(-1)
=1*1
=1
5
n=0 y(-1)= Σ x(k)*h(-k)
k=-1
=x(0)*h(0)+x(1)*h(-1)
=1*2+2*1
=4
5
n=1 y(-1)= Σ x(k)*h(1-k)
k=-1
=x(0)*h(1)+x(1)*h(0)+x(2)*h(-1)
=1*1+2*2+3*1
=8
5
n=2 y(-1)= Σ x(k)*h(2-k)
k=-1
=x(0)*h(2)+x(1)*h(1)+x(2)*h(0)+x(3)*h(-1)
=1*-1+2*1+3*1+1*1
=8
5
n=3 y(-1)= Σ x(k)*h(3-k)
k=-1
=x(1)*h(2)+x(2)*h(1)+x(3)*h(0)
=2*-1+3*1+1*2
=3
5
n=4 y(-1)= Σ x(k)*h(4-k)
k=-1
=x(2)*h(2)+x(3)*h(1)
=3*-1+1*1
=-2
5
n=5 y(-1)= Σ x(k)*h(5-k)
k=-1
=x(3)*h(2)
=1*-1
=-1
Therefore y(n)={1,4,8,8,3,-2,-1}
↑
Algorithm:
Testing:
Input:
- Upper & lower limits for sample x & h.
- Values of the sample i.e. x(n) & h(n).
Output:
Convolution of sample x(n)& h(n) i.e. Y(n).
Conclusion:
In this way we can find the linear Convolution of any two sequences.
Assignment No. 3
Title of Assignment:
Find the output of a given system described by given difference equation & initial
conditions for given input sequence.
There are 2 methods to obtain solution for given coefficient difference equation
1. Direct method
2. Indirect method
N N
Y (n) = -Σ ak* y (n-k) + Σ bk * x (n-k) ------1
K=1 k=0
N N
-Σ ak* y (n-k) = a0* y(n) + Σ ak * y (n-k)
K=1 k=1
N N
-Σ ak* y (n-k) = a0* y(n) + Σ ak * y (n-k) ----2
K=1 k=0
N N
Y (n) =a0*y(n) -Σ ak* y (n-k) + Σ bk * x (n-k)
K=0 k=0
N N
Y (n) = y(n) -Σ ak* y (n-k) + Σ bk * x (n-k)
K=0 k=0
N N
Σ ak* y (n-k) = Σ bk * x (n-k) -------3
K=0 k=0
N
Σ ak* y (n-k) = 0 -------4
K=0
[yh(n)] = rⁿ
Replace n by n-k
[yh(n-k)] = r ⁿ-k
Putting this values in equation 4
N
Σ ak * rⁿ-k = 0 -------4
K=0
The term inside the bracket is called as characteristic polynomial of the system. This
polynomial has N roots, which can be real or complex valued.
Example:
for n=0
N
Σ ak y(n-k)
K=1
= a[1]*y[-1]+a[2]*y[-2]
= 1*0+0*0
=0
N
Σ ak x(n-k)
K=0
= b[0]*x[0]+b[1]*x[-1]
= 2*1+2*0
=2
As
N N
Y (n) = -Σ ak* y (n-k) + Σ bk * x (n-k)
K=1 k=0
So y(0) = 2-0
=2
for n=1
N
Σ ak y(n-k)
K=1
= a[1]*y[0]+a[2]*y[1]
= 1*2+0*0
=2
N
Σ ak x(n-k)
K=0
= b[0]*x[1]+b[1]*x[0]
= 2*2+2*1
=6
As
N N
Y (n) = -Σ ak* y (n-k) + Σ bk * x (n-k)
K=1 k=0
So y(1) = 6-2
=4
y(n) = {2,4}
Design Analysis / Implementation Logic:
Algorithm:
Testing:
Input:
No. of coefficients of ak denoted as N
Values of a1,a2,a3 …….
No. of coefficients of bk denoted as M
Values of b1,b2,b3 …….
No . of samples of x(n) denoted as L
Values of x(0),x(1)………
Assumptions: –The no. of samples computed for y(n) are same as no. of input
samples i.e. L.
–All initial conditions are zero.
Conclusion:
In this way we can find the solution of linear constant coefficient difference equation.
Assignment No. 4
Title of Assignment:
Find circular convolution of a given two sequences.
Relevant Theory / Literature Survey:
N-1 N-1
Σ x(k)* h(n-k) = Σ x(n-k)* h(k)
k=0 k=0
Where x(k) and h(k) are the DFT’s of length N signals corresponding to one period of (n)
& h(n) respectively.
Proof:
N-1 -kn
y(n)=1/N Σ H(k)* X(k)* Wn
k=0
N-1
y(n)= Σ X(ρ ) * h(n- ρ )
ρ =0
When computing all the sequence shifts involved are circular. Product of two DFT
actually corresponds to the circulation convolution in time domain.
Circular convolution in time domain is equivalent to liner convolution.
Since x(n) and h(n) has a period N and has to be specified only for 0≤n≤N-1 then
N-1
y(n)= Σ x(ρ ) * h(n- ρ )
ρ =0
N-1 N-1
= Σ x(ρ ) * h(n- ρ ) + Σ x(ρ ) * h(n- ρ +N)
ρ =0 ρ =n+1
for 0<=n<=n-1
N-1
y(n) = Σ X(ρ ) * h((n- ρ ))mod N
ρ =0
= x(n) * h(n)
Example:
x(n) = {1,1,1,1,-1,-1,-1,-1}
h(n) = {0,1,2,3,4,3,2,1}
y(0) 1 –1 –1 –1 –1 1 1 1 0
y(1) 1 1 –1 –1 –1 –1 1 1 1
y(2) 1 1 1 –1 –1 –1 –1 1 2
y(3) = 1 1 1 1 –1 –1 –1 –1 3
y(4) –1 1 1 1 1 –1 –1 –1 4
y(5) –1 –1 1 1 1 1 –1 –1 3
y(6) –1 –1 –1 1 1 1 1 –1 2
y(7) –1 –1 –1 -1 1 1 1 1 1
hence
y(m) = {-4,8,-8,-4,4,8,8,4}
Testing:
Input:
- Input Sequences x(n) & h(n).
Output:
Circular Convolution of sample x(n) & h(n) i.e. Y(n).
Conclusion:
In this way we can find the circular convolution of a given two sequences.
Assignment No. 5
Title of Assignment:
Write a program to accept pole zero locations to generate pole zero plot & all possible
ROC’s.
Here z1, z2, z3 etc. are zeroes of the system and p1, p2, p3 are poles of the system.
The poles and zeroes can have complex variable. The coefficient of numerator and
denominator are obtained separately. Let us consider the polynomial having zeroes
N(z) = (z-z1)(z-z2)(z-z3)(z-z4)
N1Z1– [(z– r1 ejw1)(z– r2 ejwz)(z– r3 ejwz) (z– r4 ejwz) – z2–(r ejw1+ r2 ejwz)z+r1r2
ej(w1+w2)][z2–(r3ejw3+r4 r4 ejw4)z+r3r4 ej(w3+w4)]
In above equation coefficient of z3z2z1z0 we obtained from the coefficients are nothing but
coefficients b0b1b2b3
b0 = always z4 coefficient
b1 = coefficient of z3
b2 = coefficient of z2
b4 = coefficient of z0
Example:
y(n)= x(n)+3x(n-1)+3x(n-2)+x(n-3)
Plot pole-zero diagram assuming y(n)=0 for n<0 find the value of y(n) for n=0,1,2,3,4,5
for x(n) = δ (n)
h(z) = z3+3z2+3z+1/z3
= (z+1)3/z3
Thus h(z) has 3 zeroes at z= –1 and 3 poles at z=0 the pole zero diagram is
Im(z)
+j : 3 poles
3 zeroes
Re(z)
-1 1
-j
Algorithm:
Conclusion:
In this way we can generate pole zero plot.
Assignment No. 6
Title of Assignment:
Write a program to plot magnitude & phase response of a given system.
N-1
π
x(n) = ∑ ck ej2 kn/N ………….1
k=0
Where the {ck} are the coefficients in the series representation, to derive the Fourier
coefficients we use the following formula
N-1
π
∑ ej2 kn/N = N k=0,+N,–N,+2N,–2N ………….
1.1
n=0
N-1
∑ an = N a =1
n=0 1-aN/1-a a !=1 ……………1.2
The expression for Fourier coefficient ck can be obtained by multiplying both the sides of
πρ
above equation by the exponential e–j2 n/N and summing the product from m=0 to n=N-1
thus
N-1 N-1 N-1
–j2π ρ n/N π ρ
∑ x(n) e = ∑ ∑ ck ej2 (k- )n/N……………..1.3
n=0 n=0 n=0
if we perform summation over n first the right hand side of above equation we obtain
N-1
π ρ
∑ ej2 (k- )n/N = N k-ρ =0,+N,–N,+2N,–2N …………1.4
n=0 0 otherwise
where we have made use of 1.1 therefore the R.H.S. reduces to Ncρ and hence
N-1
π ρ n/N
Cρ = 1/N ∑ x(n) ej2 ρ =0,1,2,…….N-1 …………1.5
n=0
thus we have the desired expression for the Fourier coefficients in terms of signal x(n)
Synthesis equation:
N-1
π ρ
x(n) = ∑ ck ej2 (k- )n/N
n=0
Analysis equation:
N-1
π ρ
ck = 1/N ∑ x(n) e-j2 (k- )n/N
n=0
The Fourier transform of a fini9te energy discrete time signal x(n) is defined as
∞
x(n) = ∑ x(n) e-jwn ……………..
2
n=- ∞
x(w) is decomposition of x(n) into it’s frequency components x(w) is periodic with period
2π i.e.
∞
π
x(w+2π ) = ∑ x(n) ej(w+2 k)n
n= - ∞
∞
π
= ∑ x(n) e-jwn e-j2 kn
n= - ∞
∞
= ∑ x(n) e-jwn = x(w) ………………
2.1
n= - ∞
From the decomposition of Fourier transform x(w) of the sequence x(n) given by
equation 2, we observe that x(w) has the form of a Fourier series .let us evaluate
sequence x(n) from x(w). multiply both the sides of eq. 2 by ejwm and integrate over the
interval (–π ,π ) thus we have
π π ∞
∫ x(w) e dw .= ∫ [ ∑ x(n) e-jwn ]. e-jwn dw ………………2.2
jwm
–π –π n= - ∞
The input part of 2.2 can be evaluated if we can interchange the order of summation &
integration. The interchange is possible if
N
xN(w) = ∑ x(n) e-jwn
n = –N
Converges uniformly to x(w) as N→ ∞
π
∫ ejw(m-n) dw = 2π m=n
–π 0 m≠ n
consequently
∞ π
∑ x(n) ∫ ejw(m-n) dw = 2π x(m) m=n …………..2.3
n= –∞ π 0 m≠ n
Example:
Obtain F.T. of x(t) = e–at u(t)
∞
x(w) = ∫ x(t) e–jwt dt
n=–∞
∞
x(w) = ∫ e–at e–jwt dt
n=–∞
∞
= ∫ e–t(a+jw) dt
n=–∞
= [1/-(a+jw) e–t(a+jw)]
= 1/a+jw
Assuming a = 2
–tan–1 (w/a)
w 1/sqrt (a2+w2)
-w 0 90
-2 35 45
0 2 0
2 35 -45
∞ 0 -90
Magnitude plot
–∞ –2 ∞
Phase plot
. 90
–∞ –2 –2 w
–90
Algorithm:
Conclusion:
In this way we can plot magnitude & phase response of a given system.
Assignment No. 7
Title of Assignment:
Find N-point DFT/IDFT of given complex sequence x (n)/x (k).
Relevant Theory / Literature Survey:
Discrete Fourier Transform:
The DFT of a finite duration sequence x(n) is obtained by sampling the Fourier transform
X(ejw) at N equally spaced points over the interval 0≤w ≤2π with a spacing of 2π /N.
The DFT denoted by x(k) is defined as
The Fourier transform X (e^jw) is periodic in w, with period 2π and its inverse Fourier
transform is equal to discrete-time sequence x (n). we know that when a continuous time
signal is sampled with sampling time T, the spectrum of resulting discrete time sequence
becomes a periodic function of frequency with period 2π /T similarly when X(e^jw) is
sampled with sampling period 2π /N the corresponding discrete time sequence xp(n )
becomes periodic in time with period N.
∞
Where xp(n) = Σ x (n-ρ N )
ρ =-∞
Thus the periodic sequence xp (n) corresponding to x(k) for k=0 to N-1 obtained by
sampling X(e^jw) in the interval 0 to 2π is formed from x(n) by adding together an
infinite number of shifted replicas of x(n). let us consider an example in which sequence
x(n) is of length L=9 and the value of the frequency spectrum of x(n) taking 10 sampling
points (i.e. N>L) over the interval 2π we obtain a periodic sequence xp(n) in which the
delayed replicas of x(n) do not overlap and one periodic of the periodic sequence xp(n) is
recognizable as x(n).below in fig. c the same sequence is used but the value of N is equal
to 7 (i.e. N<L). in this case the replicas of x(n) overlap and one period of xp(n) is not
identical to x(n). this is a form of time-domain aliasing which is due to under sampling of
Fourier transform of x(n).
From above discussion we find that the sequence x(n) cant be recovered from xp(n)
when the no. of sampling points ⁿ is less the length of sequence L. if N>L, x(n) can be
recovered through the relation.
Let x(n) is a casual , finite duration sequence containing L samples, then it’s F.T.
given by
L-1
x(e ) = Σ x (n ) e ^-jwn ……………..2
jw
n=0
L-1
π
x(k) = x(e ) w=2π K/N = Σ x (n ) e -j2 k/N ………….3
jw
n=0
Since time domain aliasing occurs in N <L to prevent it we increase duration of x(n)
from L to N samples by appending appropriate number of zeros, which is zero
padding. Since zero valued elements contribute nothing to sum of eq. 3 can be written
as
L-1
π
x(k) = Σ x (n ) e -j2 k/N 0≤w ≤2π
n=0
N-1
π
xp(n) = 1/N Σ xp (k ) ej2 kn/N ………………4
k=0
we already know that D.F series coefficients xp(k) of periodic sequence xp(n) is
itself a periodic sequence with period N. the DFT x(k) is related to DFS coefficients
xp(k) by
N-1
π
x(n) = 1/N Σ x (k ) e j2 kn/N
k=0
DFT
N-1
π
x(k) = Σ x (n ) e-j2 kn/N 0≤k ≤N-1 …………6
n=0
IDFT
N-1
π kn/N
x(n) = 1/N Σ x (k ) e j2 0≤n ≤N-1 …………7
n=0
we can represent
Example:
Len N =L=4
We have
N-1
π kn/N
x(k) = Σ x (n ) e-j2 k=0,1,…….N-1
n=0
3
x(0) = Σ x (n ) = x(0)+x(1)+x(2)+x(3)
n=0
= 1+1+0+0
=2
3
x(1) = Σ x (n ) * e-jnπ ./2 = x(0)+x(1)*e^-jπ ./2+ x(2)*e^-jπ .+x(3)* e^-j3π ./2
n=0
= 1+cos π /2-jsin π /2
=1-j
3
x(2) = Σ x (n ) * e-jnπ = x(0)+x(1)*e^-jπ .+ x(2)*e^-j2π .+x(3)* e^-j3π .
n=0
= 1+cos π -jsin π
=1-1
=0
3
x(3) = Σ x (n ) * e-j3nπ /2.= x(0)+x(1)*e^-j3π /2.+x(2)*e^-j3π .+x(3)* e^-j9π /2.
n=0
= 1+cos 3π /2-jsin 3π /2
=1+j
x(k) = {2,1-j,0,1+j}
N-1
π
x(n) = 1/N Σ x (k ) e j2 kn/N
n=0
1 1 1 1 1 1 1 1
W= 1 –j -1 j w* = 1 j -1 -j
1 -1 1 -1 1 -1 1 -1
1 j -1 -j 1 -j -1 j
1 1 1 1 4
Xn=1/4 1 –j -1 j 1-j
1 -1 1 -1 -2
1 j -1 -j 1+j
4
Xn=1/4 8
0
4
x (n) = {1, 2, 0, 1}
Algorithm:
1. Accept the input sequence x (n) from user for which DFT has to tb derive
2. To determine DFT accept the N point i.e. how much pt DFT is to compute.
3. now starting from n=0 to N-1 we have to find the DFT of given sequence using the
formula
N-1
π
x(k) = Σ x (n ) e -j2 kn/N k=0,1,…….N-1
n=0
4. Similarly for IDFT we have to accept the input sequence X(k) from user.
5. Also accept the N point to compute IDFT.
6. Now starting from k=0 to N-1 we have to find the IDFT of given sequence using the
formula
N-1
π
x(n) = 1/N Σ x (k ) ej2 kn/N n=0,1,……….N-1
n=0
Testing:
Input sequence x (n) for calculating DFT
Input sequence x (k) for calculating IDFT
Conclusion:
In this way we can find N-point DFT/IDFT of given complex sequence x (n)/x (k).
Assignment No. 8
Title of Assignment:
Compute circular convolution of a given two sequences using DFT & IDFT.
DFT DFT
If x1(n) X1(k) and x2(n) X2(k) then
N N
DFT
x1(n) * x2(n) X1(k)*X2(k)
N
Proof:
Consider two discrete time sequences x1(n & x2(n). the DFT of x1(n) & x2(n) is
expressed as
N-1
π kn/N
X1(k) = Σ x1(n) * e–j2 k= 0,1,……….N-1 …………..1
n=0
N-1
π ρ
X2(k) = Σ x2(n) * e–j2 k /N k= 0,1,……….N-1 …………..2
ρ =0
N-1
π
Y(m) = 1/N Σ y(k) * ej2 km/N ………..4
k=0
N-1
π
Y(m) = 1/N Σ X1(k) * x2(k) * ej2 km/N ………..4
k=0
π k(m-n-ρ )/N
e–j2 = [e–j2π (m-n-ρ )/N]k ………………6
N-1
we know that Σ ak = N a=1
k=0 1-aN/1-a a≠ 1
case I: a=1
if (m-n-ρ ) is multiple of N which means (m-n-ρ )= N,2N,3N then
π π (2) π (3)
a = ej2 = ej2 = ej2 =1
Thus when (m-n-ρ ) is multiple of N then according to equation 7 the third
summation equals to N
N-1
Σ ak = 1-aN/1-a
k=0
Now
N-1
π (m-n-ρ ) k
Σ (ej2 ) = 1– ej2π (m-n-ρ )/1- ej2π (m-n-ρ )/N
k=0
π ρ
Here m, n, ρ are integers thus ej2 (m-n- ) = –1 always
The R.H.S. becomes 0 when a≠ 1 So to get the result of equation 7 we have to consider
the condition a = 1. That means when (m-n-ρ ) is multiple of N for this condition we
have the result of summation equals to N thus
N-1 N-1
Y(m) = 1/N Σ x1(n) Σ x2(ρ ) * N
n=0 ρ =0
N-1 N-1
Y(m) = Σ x1(n) Σ x2(ρ ) ……………8
n=0 ρ =0
we have obtained equation 8 for the condition (m-n-ρ ) is multiple of N this is expressed
as
(m-n-ρ ) = –p*N ………………9
Where p is an integer & an integer can be +ve or –ve. For the simplicity we have
considered –ve integer now from 9 we get
ρ = m–n+p*N
N-1
Y(m) = Σ x1(n) x2(m–n+pN) ……………10
n=0 ρ =0
we are not considering the 2nd summation in 8 because in terms of ρ and exponential
terms is absent. Now the term x2(m–n+pN) indicates a periodic sequence with period N.
we know if sequence is periodic & it is delayed then it can be represented as
The sequence x2(n) is shifted circularly hence this type of circulation is called circular
convolution.
Example:
x(n) = {1,1,1,1,-1,-1,-1,-1}
h(n) = {0,1,2,3,4,3,2,1}
y(0) 1 –1 –1 –1 –1 1 1 1 0
y(1) 1 1 –1 –1 –1 –1 1 1 1
y(2) 1 1 1 –1 –1 –1 –1 1 2
y(3) = 1 1 1 1 –1 –1 –1 –1 3
y(4) –1 1 1 1 1 –1 –1 –1 4
y(5) –1 –1 1 1 1 1 –1 –1 3
y(6) –1 –1 –1 1 1 1 1 –1 2
y(7) –1 –1 –1 –1 1 1 1 1 1
hence
y(m) = {-4,8,-8,-4,4,8,8,4}
find the circular convolution of given samples using DFT & IDFT.
x(n) = {1,1,1,1}
h(n) = {5,6,7,8}
X4=W4 * x(n)
1 1 1 1 1
1 -j -1 j 1
X4 = 1 -1 1 -1 1
1 j -1 -j 1
X4 = {4,0,0,0}
1 1 1 1 5
W4 = 1 -j -1 j 6
1 –1 1 –1 7
1 j -1 –j 8
H4 = {26,-2+2j,-2,-2-2j}
XN = ¼ 1 1 1 1 104
1 j -1 -j 0
1 -1 1 -1 0
1 -j -1 j 0
x(n) = {26,26,26,26}
Algorithm:
Input:
- Input Sequences x(n) & h(n).
Output:
Circular Convolution of sample x(n) & h(n).
Conclusion:
In this way we can calculate circular convolution of two sequences using DFT & IDFT
Assignment No. 9
Title of Assignment:
Implement 8-point Radix-2 DIT FFT algorithm
Relevant Theory / Literature Survey:
First stage:
Let x(n) be input sequence containing ‘N’ samples now we divide x(n) into even &
odd sequences.
Hence x(n) = f1(m) +f2 (m)………….1
I/p sequence has N samples so decimation f1(m) & f2(m) will contain N/2 samples.
N-1
X(k) = Σ x(n) * WknN ………………4
n=0
we can write
we put n=2m in even sequence & n=2m+1 in odd sequence. Both sequence contain N/2
samples so,
(N/2)-1 (N/2)-1
X(k) = Σ x(2m) * W N + Σ x(2m+1) Wk(2m+1)N ………….6
2km
m=0 m=0
x(2m) is even sequence so it is f1(m) & x(2m+1) is odd so it is f2(m) we also know
W2N = WN/2
(N/2)-1 (N/2)-1
X(k) = Σ f1(m) * (W N) + W N Σ f2(m) (W2N) km………….7
2 km k
m=0 m=0
(N/2)-1 (N/2)-1
X(k) = Σ f1(m) * (WN/2) + W N Σ f2(m) (WN/2) km………….8
km k
m=0 m=0
Comparing this with definition of DFT
Here F1(k) is N/2 pt DFT of f1(m) & F2(k) is N/2 point DFT of f2(m). That means
F1(k) & F2(k) are 4-point DFT’s Equation 9 indicates F2(k) is multiplied by W kN &
added with f1(k) to obtain 8-point DFT. Now F1(k) & F2(k) are 4-point (N/2) DFT.they
are periodic with period N/2.using periodic property of DFT we write,
F1(k+N/2) = F1(k)………. 10
F2(k+N/2) = F2(k)………. 11
Wk+N/2N = –WkN
Thus for N=8 we have the range for k=0 to k=1 here G 11(k) is DFT of g11(n) and G12(k) is
DFT of g12(n) using equation 19
Here the values of k are 0 & 1 that means it is 2-point DFT.thus equation 21 & 22 shows
we can obtain 4-point DFT by containing two 2-point DFT’s.
Here
g11(n) = f1(2m)=x(4n) = {x(0),x(4)}
g12(n) = f1(2m+1)=x(4n+2) = {x(2),x(6)}
Similarly
g21(n) = f2(2m)=x(4n+1) = {x(1),x(5)}
g22(n) = f2(2m+1)=x(4n+3) = {x(3),x(7)}
N-1
X(k) = Σ x(n) * WknN k=0,1,……..N-1 ……………… A
n=0
Using this equation consider first block of DFT
x(0) G11(0)
g11(n) g11(0) 2-Point G11(k) wher k = 0 &1
where n is 0,1 x(4) DFT G11(1)
g11(1)
here i/p sequences are g11(0) & g11(1) .we denote as g11(n) where 0 to 1 ,G11(k) is DFT of
g11(n).
1
G11(k) = Σ g11(n) * Wkn2 k=0,1 ……………… B
n=0
g11(0) –1 – -
x(0) G11(0)
g11(1) G11(1)
x(4) –1 +
g11(0) –1 – -
x(0) G11(0)
Example:
Find X(k) using DIFFT.
X(n)= {-1,0,2,0,-4,0,2,0}
W08 = e0=1
π
W18 = e-j /4= 0.707–j0.707
π
W28 = e-j /2= –j
π
W38 = e-j3 /4= 0.707–j0.707
Output of stage1
Output of stage2
Final output
X(k) = {–1,3,–9,3,–1,3,–9,3}
Algorithm:
Testing:
Input:
- Input Sequences x(n)
Output:
DIT FFT of x(n) i.e. x(k).
Conclusion:
In this way we can Implement 8-point Radix-2 DIT FFT algorithm
Assignment No. 10
Title of Assignment:
Implement DFT using Goertzel Algorithm
N-1
X(k) = Σ x (m)* W –k(N-m)N
m=0
Let us consider the LTI system as shown in the fig. Which has input x(n)
Let the unit sample response of this system can be given as,
hk(n)=W–knN
Linear convolution is given as,
∞
yk(n)= Σ x(m)* hk(n-m)
m=-∞
∞
yk(n)= Σ x(m)* W–k(n-m)N
m=-∞
N-1
yk(n)= Σ x(m)* W–k(n-m)N
m=-∞
∞
yk(n) = Σ x(m)* W–k(n-m)N
n=N m=-∞
Example:
N-1
We know that X(k) = Σ x (m)* W –k(N-m)N …….. 1
m=0
N-1
yk(n)= Σ x(m)* hk(n-m) hk(n)=W–k(n-m)N * u(n-m)
m=-∞
Algorithm:
1. Accept the no. of i/p sample i.e. N from user according to that accept input sample
x(n).
2. Accept the point at which the DFT is to calculate i.e. K.
3. Compute the linear convolution over the range n=9 to N-1 for x(n)* W –k(N-m)N
4. As twiddle factor involves real & imaginary we can separate the real & imaginary
Terms for calculation,
N-1 N-1
Σ x(m)* real + j Σ x(m)* img
m=0 m=0
Testing:
Input: input sequence x(n) & the pt at which the DFT is to be calculate
Conclusion:
In this way we can calculate the DFT of any sequence using Goertzel algorithm.
Assignment No. 11
Title of Assignment:
Find the Fourier transform of various windows function.
and hd can be obtained by equation taking inverse Fourier transform of Hd(w) i.e.
π
Hd(w) = 1/2π ∫ Hd(w) * ejwn ------- 2
–π
Generally this is the desired unit sample response. Unit sample response obtained by
equation 2 is infinite in duration. Since we are designing a finite impulse response filter
the length of hd(n) is truncated to length m. this is equivalent to multiplying hd(n) by
window sequence w(n). This can be best explained by considering a particular type of
window sequence.
m-1
HR(w) = Σ HR(n) * e–jwn ………
6
n=0
Here we can use
N2
Σ ak = aN1-aN2-1/1-a ……….. 8
k=N1
Equation 7 becomes
wR(w) = sin(wm/2)/sin(w/2)
Algorithm:
1. Accept the length of window (m) from user.
2. Accept the type of window.
3. Using the standard formula calculate the coefficients of that window.
4. Calculate the Fourier transform of window coefficient. Use step π /640 while
calculating.
5. Display magnitude & phase of window.
Testing:
Input: length of the window
Conclusion:
In this way we can obtain the Fourier transform of various windows function.
Assignment No. 12
Title of Assignment:
Design a DT IIR Butterworth filter for given specification using Bilinear Transformation.
m0 (-z) 2 = 1/1+(N/2c)2n
These are important steps in design of IIR butterworth filter by bilinear transformation.
Design Analysis / Implementation Logic:
Algorithm:
Testing:
Conclusion:
In this way we can Design a Butterworth filter for given specification using Bilinear
Transformation