You are on page 1of 6

PROGRAM FOR UP SAMPLING AND DOWN SAMPLING

Aim: To perform up sampling or interpolation and down sampling or decimation of a given sequence.

Algorithm:

Enter the length of the sequence.

Enter the up sampling factor.

Enter the down sampling factor.

Enter the sequence.

Input: N=8, L=3, X=[0 1 2 3 4 5 6]

Theory:

The sampling process is also known as up sampling rate.

The sampling process of increasing the sampling rate expansion.

Let l be the integer interpolation factor.

TI/T = 1/2

FI = 1/ TI = 2/T = IF

y(n) = ∑ h(n-k)w(k)

Result: Up sampling and Down sampling of a given sequence are performed.


VERIFICATION OF SAMPLING THEOROM

Aim: To write a program for verifying the sampling theorem.

Algorithm:

Define input sequence which has two frequency components w1 & w2.

Initiate the time vector.

Use the sampling rates are above and below the nyquist sampling rate

Observe that from over sampling we can more accurately reconstruct the original signal and
reconstruction from an under sampled signal.

Theory: According to sampling theorem which states that band limited signal h(t) having no frequency
components alone fb hertz is completely specified by samples that are taken at a uniform rate greater than
2fn.

Result: Thus the sampling theorem is programmed and verified.


PROGRAM FOR WINDOWING TECHNIQUES

Aim: To write a program for windowing techniques such as rectangular, barlett, blackmann, hamming,
hanning and Kaiser windows.

Algorithm:

Get the pass band and stop band edge frequencies.

Get the pass band and stop band ripples.

Get the order of filters.

Calculate sampling frequency.

Draw the magnitude and phase response.

Theory:

Rectangular, barlett, blackmann, hamming, hanning and Kaiser windows.

The oscillations in the pass band and stop band can be reduced through the useful of less abrupt
truncation of the fourier series.

This can be achieved by multiplying the infinite impulse response with a finite weighing sequence w(n)
called a window.

FIR filters with linear phase can be determined by windows method.

Corresponding functions for calculation of window oscillators in pass band and stop band are used.

Result: The o/p response of the rectangular, barlett, blackman, hamming, hanning and Kaiser windows
are obtained and plotted.
PROGRAM FOR CONVOLUTION

Aim: To write a program for linear convolution with and without shift, circular convolution and
exponential convolution

Algorithm:

Enter the first sequence.

Enter the second sequence.

Get the convolution of two sequences using the function.

Plot he graphs for the two sequences and the convoluted o/ signal.

Theory:

Linear convolution: The convolution of two sequences is known as discrete convolution or linear
convolution.

Let x(n) be the i/p to an LTI system.

G(n) be the o/p and

H(n) be the response of the system.

As impulse response y(n) of discrete time system can be expressed as convolutional sum of the i/p
sequence x(n) impulse

y(n) = ∑ X(k)h(n-k)

Circular convolution: In circular convolution if x(n) contains the L no. of samples and h(n) with m
samples. Then

N = max(L,m) samples

Let x1(n) and x2(n) are finite duration sequences then DFT is X1(f), X2(f)

Xs(f) = ∑ x1(n)x2(n-3)N

Exponential convolution: This is similar as obtaining the exponential response with reference to the
length of the sequence i/p multiplied by a factor ‘a’ and impulse sequences are made under the process
convolution.

Result: Thus the linear convolution with and without shift, circular convolution and exponential
convolution of a given sequence are performed and o/p is observed.
PROGRAM FOR DIFFERENCE EQUATION

Aim: To determine the step response, exponential response, impulse response of a given difference
equation.

Algorithm:

Enter the length of the sequence.

Enter the numerator coefficients.

Enter the denominator coefficients.

Using the function =filter(p,d,k) in MATLAB.

Solving difference equation.

Theory:

Step response: The function filter process the i/p data vector x using the system characterised by the
coefficients vector p.

Exponential response: An exponential sequence/signal is that varies exponentially with time using the
filter function in MATLAB we can able to solve the difference equation.

Impulse response: An impulse signal is that varies or having amplitude only at t=0 or n=0 using the filter
function in MATLAB we can able to solve the difference equation.

Result:

The step response,exponential response, impulse response of a given difference equation is solved and
results are plotted.
PROGRAM FOR AUTO CORRELATION & CROSS CORRELATION

Aim: To write a program for computing auto correlation and cross correlation between two sequences.

Algorithm:

Enter the input sequence.

Enter the auto correlation and cross correlation functions.

Plot the graphs for the input sequence and output sequence.

Input, x = [1 2 3 4]

h =[4 3 2 1]

Theory:

The correlation is a measure of the degree to which 2 sequences are coincide. If the correlation is
between i/p sequence and it’s time delay version then it is auto correlation and cross correlation is
between two different sequences.

Result: The auto correlation and cross correlation between the sequences are computed.

You might also like