Você está na página 1de 25

EXPERIMENT 6

IMPLEMENTATION OF LP FIR FILTER FOR A GIVEN


SEQUENCE
AIM: To design a LP FIR filter using Rectangular, Hamming, Hanning, Blackmann and Bartlett
windowing techniques.

ALGORITHM:
 Assign the values for cut-off frequency, number of sample points ‘n’.
 Find the filter co-efficient h for LPF.
 Find the frequency response of filter.
 Plot the magnitude and phase response.
 Give the x label and y label and title to it.

THEORY:
INTRODUCTION TO FILTERS:
Analog and digital filters
In signal processing, the function of a filter is to remove unwanted parts of the signal,
such as random noise, or to extract useful parts of the signal, such as the components lying
within a certain frequency range.
The following block diagram illustrates the basic idea.

There are two main kinds of filter, analog and digital. They are quite different in their physical
makeup and in how they work.

An analog filter uses analog electronic circuits made up from components such as resistors,
capacitors and op amps to produce the required filtering effect. Such filter circuits are widely
used in such applications as noise reduction, video signal enhancement, graphic equalisers in hi-
fi systems, and many other areas.
The analog input signal must first be sampled and digitised using an ADC (analog to digital
converter). The resulting binary numbers, representing successive sampled values of the input
signal, are transferred to the processor, which carries out numerical calculations on them. These
calculations typically involve multiplying the input values by constants and adding the products
together. If necessary, the results of these calculations, which now represent sampled values of
the filtered signal, are output through a DAC (digital to analog converter) to convert the signal
back to analog form.
The following diagram shows the basic setup of such a system.

FIR FILTERS

Finite impulse response (FIR) filters are the most popular type of filters implemented in
software. This introduction will help you understand them both on a theoretical and a practical
level.

A digital filter takes a digital input, gives a digital output, and consists of digital
components. In a typical digital filtering application, software running on a digital signal
processor (DSP) reads input samples from an A/D converter, performs the mathematical
manipulations dictated by theory for the required filter type, and outputs the result via a D/A
converter.

An analog filter, by contrast, operates directly on the analog inputs and is built entirely with
analog components, such as resistors, capacitors, and inductors.
There are many filter types, but the most common are lowpass, highpass, bandpass, and
bandstop. A lowpass filter allows only low frequency signals (below some specified cutoff)
through to its output, so it can be used to eliminate high frequencies. A lowpass filter is handy, in
that regard, for limiting the uppermost range of frequencies in an audio signal; it's the type of
filter that a phone line resembles.

A highpass filter does just the opposite, by rejecting only frequency components below some
threshold. An example highpass application is cutting out the audible 60Hz AC power "hum",
which can be picked up as noise accompanying almost any signal in the U.S.
The designer of a cell phone or any other sort of wireless transmitter would typically place an
analog bandpass filter in its output RF stage, to ensure that only output signals within its
narrow, government-authorized range of the frequency spectrum are transmitted.

Engineers can use bandstop filters, which pass both low and high frequencies, to block a
predefined range of frequencies in the middle.

Frequency Response

Simple filters are usually defined by their responses to the individual frequency components that
constitute the input signal. There are three different types of responses. A filter's response to
different frequencies is characterized as passband, transition band, or stopband. The passband
response is the filter's effect on frequency components that are passed through (mostly)
unchanged.Frequencies within a filter's stopband are, by contrast, highly attenuated. The
transition band represents frequencies in the middle, which may receive some attenuation but are
not removed completely from the output signal.

In Figure 1, which shows the frequency response of a lowpass filter, ωp is the passband ending
frequency, ωs is the stopband beginning frequency, and As is the amount of attenuation in the
stopband. Frequencies between ωp and ωs fall within the transition band and are attenuated to
some lesser degree.

Figure 1 : The response of a lowpass filter to various input frequencies

Given these individual filter parameters, one of numerous filter design software packages can
generate the required signal processing equations and coefficients for implementation on a DSP.

Before we can talk about specific implementations, however, some additional terms need to be
introduced.

Ripple is usually specified as a peak-to-peak level in decibels. It describes how little or


how much the filter's amplitude varies within a band. Smaller amounts of ripple represent more
consistent response and are generally preferable.

Transition bandwidth describes how quickly a filter transitions from a passband to a stopband, or
vice versa. The more rapid this transition, the higher the transition bandwidth; and the more
difficult the filter is to achieve. Though an almost instantaneous transition to full attenuation is
typically desired, real-world filters don't often have such ideal frequency response curves.

There is, however, a tradeoff between ripple and transition bandwidth, so that decreasing either
will only serve to increase the other.
Finite impulse response

A finite impulse response (FIR) filter is a filter structure that can be used to implement almost
any sort of frequency response digitally. An FIR filter is usually implemented by using a series
of delays, multipliers, and adders to create the filter's output.

Figure 2 shows the basic block diagram for an FIR filter of length N. The delays result in
operating on prior input samples. The hk values are the coefficients used for multiplication, so
that the output at time n is the summation of all the delayed samples multiplied by the
appropriate coefficients.

Figure 2. The logical structure of an FIR filter

%Rectangular window
Program:

Inputs:
Output:

% Hamming window
Program:

Inputs:
Output:

%Hanning window
Program:

Inputs:
Output:

%Blackmann window
Program:

Inputs:
Ouput:

% Bartlett window
Program:

Inputs:
Output:
EXPERIMENT 7
IMPLEMENTATION OF HP FIR FILTER FOR A GIVEN
SEQUENCE
AIM: To design a HP FIR filter using Rectangular, Hamming, Hanning, Blackmann and Bartlett
windowing techniques.

ALGORITHM:
 Assign the values for cut-off frequency, number of sample points ‘n’.
 Find the filter co-efficient h for HPF.
 Find the frequency response of filter.
 Plot the magnitude and phase response.
 Give the x label and y label and title to it.

%Rectangular window
Program:

Inputs:

Output:
% Hamming window
Program:

Inputs:

Output:
%Hanning window
Program:

Inputs:

Output:
%Blackmann window
Program:

Inputs:

Ouput:
% Bartlett window
Program:

Inputs:

Output:
PRE-LAB WORK QUESTION:
1. Differentiate analog filter and digital filter.
2. What are the differences between recursive and non recursive systems?
3. Define FIR filter.
4. Why is the impulse response "finite"?
5. What terms are used in describing FIR filters?
6. What is the delay of a linear-phase FIR?
7. What is the Z transform of a FIR filter?
8. What is the frequency response formula for a FIR filter?
9. How Can I calculate the frequency response of a FIR using the Discrete Fourier Transform
(DFT)?
10. What is the DC gain of a FIR filter?
11. Explain how the FIR filters are stable?
12. List a few Applications of FIR filters.
13. Explain advantages of FIR filters over IIR filters.
14. Explain limitations of FIR filters.
15. Distinguish FIR and IIR filters.
16. What is window method? How you will design an FIR filter using window method?
17. Differentiate rectangular, triangular and Kaiser Windows.
18. What is the MATLAB command for Hamming window? Explain.
19. What do you mean by built in function ‘abs’ and where it is used?
EXPERIMENT 8
IMPLEMENTATION OF LP IIR FILTER FOR A GIVEN
SEQUENCE
Aim:
To Design digital Butterworth LP IIR filter using MAT LAB.
Algorithm:
 Assign the variable for pass band ripple, stop band ripple, pass band and stop band
frequency
 Determine the order of filter using the required formula.
 Find the filter co-efficient A and B for LPF.
 Find the frequency response
 Plot the magnitude and phase responses.
 Give the x label and y label and title it to.
 Save and run the program.

THEORY:
The IIR filter can realize both the poles and zeroes of a system because it has a rational
transfer function, described by polynomials in z in both the numerator and the denominator

m and n are order of the two polynomials b(nb+1) and a(na+1) are the filter coefficients. These
filter coefficients are generated using FDS (Filter Design software or Digital Filter design
package. IIR filters can be expanded as infinite impulse response filters. In designing IIR filters,
cutoff frequencies of the filters should be mentioned. The order of the filter can be estimated
using Butterworth polynomial. That’s why the filters are named as Butterworth filters. Filter
coefficients can be found and the response can be plotted. Example IIR filters include the
Chebyshev filter, Butterworth filter, and the Bessel filter.

Program:
Output:
EXPERIMENT 9
IMPLEMENTATION OF HP IIR FILTER FOR A GIVEN
SEQUENCE
Aim:
To Design digital Butterworth HP IIR filter using MAT LAB.
Algorithm:
 Assign the variable for pass band ripple, stop band ripple, pass band and stop band
frequency
 Determine the order of filter using the required formula.
 Find the filter co-efficient A and B for HPF.
 Find the frequency response
 Plot the magnitude and phase responses.
 Give the x label and y label and title it to.
 Save and run the program.
Program:
Output:

VIVA QUESTIONS:
1. What do you mean by cut-off frequency?
2. Give the difference between analog and digital filter?
3. What is the difference between type 1 and type 2 filter structure?
4. what is the role of delay element in filter design?
5. Explain how the frequency is filter in filters?
6. Differences between Butterworth chebyshev filters?
7. Can IIR filters be Linear phase? how to make it linear Phase?
8. What is the special about minimum phase filter?
9. List some advantages of digital filters over analog filters.
10. Write some differences between FIR and IIR filters.
11. What are the different methods to design IIR filters?
12. Why IIR filters are not reliable?
13. What are different applications of IIR filters?
14. What are advantages of IIR filters?
15. What are disadvantages of IIR filters?
16. Differentiate Butterworth and Chebyshev approximations.
17. What is meant by impulse response?
18. What is the importance of impulse response to calculate the o/p response of the filter?
EXPERIMENT 10
GENERATION OF SINUSOIDAL SIGNAL THROUGH
FILTERING
AIM: To generate the sinusoidal signal using filter.

ALGORITHM:

 Assign the values for signal frequencies, Cut-off frequency, sampling frequency.
 Assign value for order of filter.
 Find the filter co-efficient a and b.
 Perform filtering of signal.
 Plot the filtered signal and magnitude response.
 Give the x label and y label and title it to.
 Save and run the program.

Theory:

The sine wave or sinusoid is a mathematical function that describes a smooth repetitive
oscillation. It occurs often in pure mathematics, as well as physics, signal processing, electrical
engineering and many other fields. Its most basic form as a function of time (t)
Where:
•A, the amplitude, is the peak deviation of the function from its center position.
•ω, the angular frequency, specifies how many oscillations occur in a unit time interval, in
radians per second
•φ, the phase, specifies where in its cycle the oscillation begins at t = 0.

Program:
VIVA QUESTION:
1. What is the special about minimum phase filter?
2. In signal processing, why we are much more interested in orthogonal transform?
3. How is the non-periodic nature of the input signal handled?
4. If a have two vectors how will i check the orthogonality of those vectors?
5. What is meant by random noise?
6. What are the specifications of digital filter?
7. What are the advantages of filtering?
EXPERIMENT 11
GENERATION OF DTMF SIGNALS
AIM:
To Write a MATLAB program for Generation of DTMF signals.

ALGORITHM:

 Assign the values for signal frequencies.


 Define symbols and arrange them in low frequency groups.
 Generate tones.
 Plot magnitude response.
 Give the x label and y label and title it to.
 Save and run the program.

THEORY:
DTMF is a signalling system for identifying the keys or better say the number dialled on a
pushbutton or DTMF keypad. The early telephone systems used pulse dialling or loop
disconnect signalling. This was replaced by multi frequency (MF) dialling. DTMF is a multi
frequency tone dialling system used by the push button keypads in telephone and mobile sets to
convey the number or key dialled by the caller. DTMF has enabled the long distance signalling
of dialled numbers in voice frequency range over telephone lines. This has eliminated the need of
telecom operator between the caller and the callee and evolved automated dialling in the
telephone switching centres. DTMF (Dual tone multi frequency) as the name suggests uses a
combination of two sine wave tones to represent a key. These tones are called row and column
frequencies as they correspond to the layout of a telephone keypad.
A DTMF keypad (generator or encoder) generates a sinusoidal tone which is mixture of the
row and column frequencies. The row frequencies are low group frequencies. The column
frequencies belong to high group frequencies. This prevents misinterpretation of the harmonics.
Also the frequencies for DTMF are so chosen that none have a harmonic relationship with the
others and that mixing the frequencies would not produce sum or product frequencies that could
mimic another valid tone. The high-group frequencies (the column tones) are slightly louder than
the low-group to compensate for the high-frequency roll off of voice audio systems.

The row and column frequencies corresponding to a DTMF keypad have been indicated in the
above figure.
DTMF tones are able to represent one of the 16 different states or symbols on the keypad. This
is equivalent to 4 bits of data, also known as nibble.

Program:
Output:
PRE-LAB WORK QUESTIONS
1. Why multi tone signal generator is required?
2. What are the advantages of multi tone signal generator?
3. What are the applications of dual tone signal generator?

Você também pode gostar