Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Digital signal processing PBL, Lecture notes of Digital Image Processing

Digital signal processing project based learning

Typology: Lecture notes

2022/2023

Available from 04/11/2023

vinay-gupta-2
vinay-gupta-2 🇮🇳

6 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Project Based Learning Report
on
Design of Low-Pass FIR Filter Using MATLAB
Submitted in the partial fulfillment of the requirements
For the Project based learning in (Digital Signal Processing)
in
Electronics & Communication Engineering
By
PRN Name of the Student
2014111045 SWASTIK GUPTA
2014111047 VINAY GUPTA
2014111056 SANKALP KANIKAR
Under the guidance of Course In-charge
1 Prof. N.T. Madkar
Department of Electronics & Communication Engineering
Bharati Vidyapeeth
(Deemed to be University)
College of Engineering,
Pune – 411043
Academic Year: 2022-23
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Digital signal processing PBL and more Lecture notes Digital Image Processing in PDF only on Docsity!

Project Based Learning Report

on Design of Low-Pass FIR Filter Using MATLAB Submitted in the partial fulfillment of the requirements For the Project based learning in (Digital Signal Processing) in Electronics & Communication Engineering By PRN Name of the Student 2014111045 SWASTIK GUPTA 2014111047 VINAY GUPTA 2014111056 SANKALP KANIKAR Under the guidance of Course In-charge 1 Prof. N.T. Madkar

Department of Electronics & Communication Engineering

Bharati Vidyapeeth

(Deemed to be University)

College of Engineering,

Pune – 411043

Academic Year: 2022-

Bharati Vidyapeeth (Deemed to be University) College of Engineering, Pune – 411043 Department Of Electronics & Communication Engineering CERTIFICATE Certified that the Project Based Learning report entitled, “ Design of Low-Pass FIR Filter Using MATLAB ” is work done by PRN Name of the Student 2014111047 VINAY GUPTA 2014111045 SWASTIK GUPTA 2014111056 SANKALP KANIKAR in partial fulfillment of the requirements for the award of credits for Project Based Learning (PBL) in Microcontroller and application of Bachelor of Technology Semester V, in Electronics and Communication Engineering Date: Dr. Arundhati A. Shinde Prof. N.T.Madkar Course In-charge Professor & Head

Problem Statement: To Design a Low-pass FIR Filter Using MATLAB.

SOLUTION :

This thesis will deal with the effect of a digital filter based on MATLAB. We will use window function, frequency sampling, and convex optimization method to design FIR filter, and also map out the figure of the characteristics of a filter. By using the filter, I will compare the time domain waveform and frequency spectrum before and after filtering sum of sinusoidal functions. The digital filter is a discrete system, and it can do a series of mathematic processing to the input signal, and therefore obtain the desired information from the input signal. The transfer function for a linear, time-invariant, digital filter is usually expressed as where ai and bi are coefficients of the filter in Z-transform. There are many kinds of digital filters, and also many different ways to classify them. According their function, the FIR filters can be classified into four categories, which are lowpass filter, high pass filter, Band-pass filter, and band stop filter. According to the impulse response, there are usually two types of digital filters, which are finite impulse response (FIR) filters and infinite impulse response (IIR) filters. According to the formula above, if ai is always zero, then it is a FIR filter, otherwise, if there is at least one none-zero ai , then it is an IIR filter. Usually, we need three basic arithmetic units to design a digital filter, which are the adder, the delay, and the multiplier. The following are several steps of designing a digital filter:

  1. Make sure of the property of a digital filter according to the given requirements.
  2. Use a discrete linear time-invariant system function to appro ach to the properties.
  3. Make use of algorithms to design the system function.
  4. Use a computer simulation or hardware to achieve it

As the figure shows, the transition band of the filter is between the passband and the stopband. The frequency ωp denotes the edge of the passband, and the band-edge frequency ωs defines the edge of the stopband. So, the difference of ωs and ωp is the width of the transition band, i.e. ωt= ωs- ωp. The ripple in the passband of the filter is denoted as δp, and the magnitude of the filter varies from 1-δp to 1+ δp. δs is the ripple in the stopband. Usually we use a logarithmic scale to show the frequency response, hence, the ripple in the passband is 20log10δp dB, and the ripple in the stopband is 20log10δs dB.

 Frequency sampling

Frequency sampling The frequency sampling method will work in following way, we start in the frequency domain, and sample the desired frequency response H(ejΩ) with N evenly-spaced samples instead of a continuous frequency, and get Hd(k)= Hd(e^jΩ)| Ω=2πk/N, (k=0,1,…, N-1). Then, let H(k)= Hd(k)= Hd(ejΩ)|Ω=2πk/N, we get the unit impulse response, h(n)=IDFT[H(k)], where IDFT is Inverse Discrete Fourier Transform. The inverse DFT then yields an impulse response which will lead to a filter whose frequency response the same as that of the specification exactly at the location of the frequency samples. The advantage of this method is that we can design filters directly in the frequency domain, but the disadvantage is that the sampling frequency can only be integer times of 2π/N, and we cannot ensure a random cutoff frequency.

 Optimization

Optimization Historically, the window function method was the first method for designing linear-phase FIR filters. The frequency sampling method and optimized equiripple method were developed in the 1970s and have become very popular since then. Lacking precise control of the specified frequencies, like ωp and ωs, is the most serious disadvantage of the window function method in the design of a lowpass FIR filter. The frequency sampling method is better than the window method in the aspect that the real- valued frequency response characteristic Hr(ω) is specified, which can be either zero or unity at all frequencies, except the transition band. The Chebyshev approximation method offers completely control of the filter requirements. As a result, this method is more preferable than the other two. It is based on the Remez exchange algorithm, which minimizes the error with respect to the max- norm

 Advantages of FIR filters:

  1. FIR filter is always stable
  2. It is simple
  3. Design complexity generally linear
  4. FIR filter is having linear phase response
  5. It is easy to optimize
  6. Non causal
  7. Transient have a finite duration
  8. Quantization noise is not much as a problem
  9. Round of noise error is minimum
  10. Both filtering recursive, as well as nonrecursive filter, can be also designed using FIR designing techniques
  11. For designing of a filter having an arbitrary magnitude response; FIR filter designing techniques can be easily applied
  12. Good performance
  13. The necessity of computational techniques for filter implementation
  14. A requirement of large storage
  15. Incapability of linear phase response  Disadvantages of FIR filters:
  16. Large storage requirements
  17. Cannot simulate prototype analog filter

The frequency response of the filter H(ω), can be obtained by replacing s = jω into the complete response of the filter is then generated by varying ω in between 0 and ∞.

 Frequency Transformations : -

The design of analogue filters other than low-pass is usually achieved by designing a low-pass filter of the desired class e.g., Butterworth, Chebyshev, or Elliptic, and then transforming the resulting filter to get the desired frequency response e.g., high-pass, band-pass, or band-stop. This is accomplished by substituting the frequency-domain transfer function H(s) with one of the relevant frequency transformations listed below. Where ω2 and ω1 are the band-edge frequencies of the desired filter and are also positive parameters satisfying ω2 > ω1.

 Advantages of IIR filter

  1. IIR filter is better than the FIR in that, it can produce the same response using some fewer delay blocks.
  2. It is easy to implement.
  3. It is easy to design.
  4. This filter is useful only when some analog filter is bandlimited.
  1. They are harder to implement using fixed-point arithmetic, such as noise generated by calculations and also limit cycles.
  2. They are more susceptible to the problem of line finite length arithmetic.
  3. An IIR filter has a lesser number of side lobes in the stopband than an FIR filter.
  4. They don't offer the computational advantages of the FIR filter for the multi-rate application system.
  5. Implementation of IIR filter involves fewer parameters, less memory requirement, and lower computational complexity.

 Disadvantages of IIR filter

  1. There are more susceptible to the problem of finite length arithmetic, such as the noise is generated by calculations, and limit cycle.
  2. They are harder to implement using fixed-point arithmetic.
  3. IIR filter becomes unstable.
  4. Lower computational complexity.
  5. Analog frequency and digital frequency are linearly related.
  6. IIR filters usually have a non-linear response, while the FIR usually has a linear phase.
  7. They don't offer the computational advantages of the FIR filter for multi-rate applications.
  8. IIR filter has a feedback loop so they will accumulate rounding and noise error.
  9. An IIR filter has a lesser number of side lobes in the stopband.
  10. The realization of the IIR filter is not very easy as compared to FIR filters.
  11. The implementation of an IIR filter involves fewer parameters needed.
  12. Less memory requirement.
  13. It is a recursive filter the number of the coefficient is very large and the memory requirement is also high.
  14. It is hard to optimize than the FIR filter.

 Comparison of FIR and IIR

  1. Under the same conditions as in the technical indicators, output of the IIR filter has feedback to input, so it can meet the requirements better than FIR. The storage units are less than those of IIR, the number of calculations is also less, and it’s more economical.
  2. The phase of FIR filter is strictly linear, while the IIR filter is not. The better the selectivity of IIR filter is, the more serious the nonlinearity of the phase will be.
  3. The FIR filter is non-recursive structure, finite precision arithmetic error is very small. While IIR filter is recursive structure, and parasitic oscillation may occur in the operation of IIR filter.
  4. Fast Fourier Transformation can be used in FIR filter, while IIR cannot.
  5. The IIR filter can make use of the formulas, data and tables of the analog filter, and only a small amount of calculation. While FIR filter design may always make use of the computer to calculate, and the order of FIR filter could be large to meet the design specifications.

 Types Of Filters

There are mainly Three types of filters:

  1. Low-pass Filter
  2. High-pass Filter
  3. Band-pass Filter
  4. Band-stop Filter / Notch Filter

 Low-pass Filter

A low-pass filter is a filter that passes signals with a frequency lower than a selected cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency. The exact frequency response of the filter depends on the filter design. The filter is sometimes called a high-cut filter, or treble-cut filter in audio applications.

Low-pass filters exist in many different forms, including electronic circuits such as a hiss filter used in audio, anti-aliasing filters for conditioning signals prior to analog-to-digital conversion, digital filters for smoothing sets of data, acoustic barriers, blurring of images, and so on. The moving average operation used in fields such as finance is a particular kind of low-pass filter, and can be analyzed with the same signal processing techniques as are used for other low-pass filters. Low-pass filters provide a smoother form of a signal, removing the short-term fluctuations and leaving the longer-term trend. Filter designers will often use the low-pass form as a prototype filter. That is, a filter with unity bandwidth and impedance. The desired filter is obtained from the prototype by scaling for the desired bandwidth and impedance and transforming into the desired band form (that is low-pass, high-pass, band-pass or band-stop).

Examples: low-pass filters occur in acoustics, optics and electronics.

 High-pass Filter

A high-pass filter (HPF) is an electronic filter that passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. The amount of attenuation for each frequency depends on the filter design. A high-pass filter is usually modeled as a linear time-invariant system. It is sometimes called a low-cut filter or bass-cut filter in the context of audio engineering. High-pass filters have many uses, such as blocking DC from circuitry sensitive to non-zero average voltages or radio frequency devices. They can also be used in conjunction with a low- pass filter to produce a Band-pass filter. In the optical domain filters are often characterised by wavelength rather than frequency. High- pass and low-pass have the opposite meanings, with a "high-pass" filter (more commonly "long- pass") passing only longer wavelengths (lower frequencies), and vice versa for "low-pass" (more commonly "short-pass") A high-pass filter attenuates frequency components below a certain frequency, called its cutoff frequency, allowing higher frequency components to pass through. This contrasts with a low- pass filter, which attenuates frequencies higher than a certain frequency, and a Band-pass filter, which allows a certain band of frequencies through and attenuates frequencies both higher and lower than the band. In optics a high pass filter is a transparent or translucent window of colored material that allows light longer than a certain wavelength to pass through and attenuates light of shorter wavelengths. Since light is often measured not by frequency but by wavelength, which is inversely related to frequency, a high pass optical filter, which attenuates light frequencies below a cutoff frequency, is often called a short-pass filter; it attenuates longer wavelengths.

Band-pass filters are categorized into two types:

  1. Wide Band-pass Filter
  2. Narrow Band-pass Filter  Wide Band-pass Filter A wide Band-pass filter (WBF) formed by cascading lowpass and high pass sections is generally an alternative circuit for ease of design and performance. It is realized by a number of feasible circuits. A ± 20 db/ decade Band-pass filter formed by a first-order low-pass and high- pass sections can be cascaded. In the same way, a ± 40 db/decade Band-pass filter can be formed by connecting a second order low-pass and high- pass filter in series. Which means, the order of the BPF (Band-pass filter) is governed by the order of the low-pass and high-pass filters it has. Wide Band-pass Filter Circuit A ± 20 db/decade wide Band-pass filter is composed of a first-order high-pass filter (HPF). A first-order low-pass filter (LPF) is shown in the below figure with its wide Band-pass filter frequency response. BPF Frequency Response

Narrow Band-pass Filter A narrow Band-pass filter employs multiple feedback and this filter uses only one operational amplifier as shown in the figure. Narrow Band-pass filter has some unique features compared to all the other filters discussed below. Narrow Band-pass Filter Circuit Narrow Band-pass filter is named as a multiple-feedback filter as it consists of two feedback paths. Generally, the narrow Band-pass filter (BPF) is designed for precise values of fc (center frequency) and Q or center frequency and BW. The required components of the circuit are determined from the following relationships. Each of the C1 & C2 can be taken equal to C for design calculation simplifications. R1 = Q / 2pfc CAf R1 = Q / 2pfc C (2Q2-Af) R3 = Q / pfc C Where ‘Af’ is the gain at the ‘fc’ center frequency and is given as Af = R3/2R However, the gain Af must satisfy the following condition. Af < 2 Q The center frequency(‘fc’) of the various feedback filters can be altered to a new frequency ‘fc’ without changing the gain or bandwidth. This is attained simply by altering R2 to R’2 so that R’2 = R2 [fc/f’c]

 Application of Band-pass filters

  1. Stop Band Frequency: Any signal in this frequency range will be attenuated by the Notch Filter.
  2. Attenuation/Rejection in the Stop Band: This is the level of attenuation that the filter will provide in the stop band. This is usually represented in dB.
  3. Insertion Loss: This is the loss that the filter will provide outside the stop band. The lower the insertion loss outside the stop band the better. Insertion Loss is represented in dB.
  4. Transition from Stopband to Passband: This may not be represented in the specs, however is important. It is a measure of how quickly the filter moves from the stop band to the passband. So, if the stop band is 2300 to 2400 MHz. How quickly does it transition to having low loss. The quicker the transition the better.
  5. Power Handling Capability of the Filter: This is the maximum power that the notch filter can handle.
  6. Package Type: There are a number of form factors and package types in which these notch filters are available. Everything RF has created a search tool to help users identify notch filter from the leading manufacturers.

 Application Of Notch Filter

Notch filters are used to remove a single frequency or a narrow band of frequencies. In audio systems, a notch filter can be used to remove interfering frequencies such as powerline hum. Notch filters can also be used to remove a specific interfering frequency in radio receivers and software-defined radio.

Software Used: -

MATLAB & Simulink are used for programming and simulation respectively for convolution codes. MATLAB INTRODUCTION: - ▪ MATLAB was invented by mathematician and computer programmer Cleve Moler. The idea for MATLAB was based on his 1960s PhD thesis. Moler became a math professor at the University of New Mexico and started developing MATLAB for his students as a hobby. He developed MATLAB's initial linear algebra programming in 1967 with his one-time thesis advisor, George Forsythe. This was followed by Fortran code for linear equations in 1971. ▪ In the beginning (before version 1.0) MATLAB "was not a programming language; it was a simple interactive matrix calculator. There were no programs, no toolboxes, no graphics. And no ODEs or FFTs."