Design an fir filter that eliminates the noise components

Assignment Help Electrical Engineering
Reference no: EM131541085

COMPUTER ASSIGNMENT: Notch Filter Design

This assignment is an introduction to notch filters. You will study the structure of notch filters and use them to remove narrowband noise components. In particular, you will create a Matlab function which would determine the location of noise components and the coefficients of corresponding FIR/IIR notch filters to eliminate the narrowband noise components from the noisy input signal.

Accessing Data: You have access to the Matlab data file ELE632 Data.mat which in- cludes two audio signals sampled at 16 kHz. After copying the data file to your working directory enter the command
>> load ELE632 Data
to access the speech samples stored in the following arrays:

Array Name

Fs [kHz]

No of samples

Duration [s]

sp16

16

40,000

2.50

sp16 noisy

16

40,000

2.50

The audio/speech data contained in ELE632 Data.mat file was originally sampled from a CBC news broadcast at 8 kHz and then upsampled to 16 kHz.

Listening to Audio/Sound Samples: You can use the built-in Matlab command sound to listen to audio samples. For example, either of the following two commands allows you to listen to noisy audio samples:
>> sound( sp16 noisy, Fs);
where Fs = 16000 is the sampling frequency.

Practice Problem:

A speech signal with bandwidth B = 3.8 kHz has been sampled at Fs = 16 kHz. The speech signal is corrupted by two sinusoids with frequencies: F1 = 800 Hz and F2 = 1.2 kHz. Display the power spectral density function of the speech samples using the Matlab function psd, e.g. psd( sp16 noisy, 2048, Fs ) (you can ignore the Matlab Warning message).

(a) Design an FIR filter that eliminates the noise components F1 and F2.

(b) Set the maximum gain of the filter to unity. Plot the magnitude response and the phase response of the filter. Process the noisy speech samples by filtering through the

FIR filter. Playback the processed speech samples and compare with the noise free speech samples.

(c) Does the filter fulfill your objectives? How can you further improve your design in part (a)? In the context of this problem, improvement means to reduce the bandwidth of the notches in the magnitude response of the filter. Compare the magnitude response of your design in part (a) and of your improved design. Also compare the filter output in both cases.

PROBLEM 1: Notch Filter Design and Implementation:

Consider a real-valued discrete-time sequence x[n], which has exactly two noise components at digital frequencies Ω1 and Ω2 where 0 < Ω1 < Ω2 < π. The objective is to design a notch/comb filter that will remove the noise components at Ω1 and Ω2. You can assume that Ωi = 2πFi and each Fi, i = 1, 2 is a rational number and all noise components have the same power. The maximum gain of the filter has to be set to unity.

Write a Matlab function notch.m which analyzes the input signal x[n] and determines the coefficients of the notch filter which would remove the frequency components as described above. The notch filter is assumed to have the transfer function H(z):

H(z) = G ∑k=0M.bkz-k/∑k=0M.k=0 akz-k (1)

where G is a gain factor; {bk}k=0M and {ak}k=0M are the real-valued numerator and denominator coefficients, respectively. The call to the notch.m function should be in the form:

[ b, a ] = notch( x, FType );

where

x: 1-dimensional, real-valued "noisy" input sequence, which can be a row or column vector;

FType: filter type; a string variable set to 'fir' or 'iir';

b: real-valued numerator coefficients of the notch filter described by the transfer function H(z) as shown in Equation (1);

a: real-valued denominator coefficients of the notch filter described by the transfer function H(z) as shown in Equation (1). If FType = ‘fir', then a0 = 1 and ak = 0, for k = 1, . . . , M.

Remark: Please note that the two noise components Ω1 and Ω2 are not known. It is the responsibility of your code to analyze the input signal and identify the frequencies of the noise components. You can use the noisy signal in sp16 noisy as a test signal, however your code should also function correctly with other test signals.

PROBLEM 2: Testing the Notch Filter:

(a) Open the Simulink model Scrambler.slx. The Simulink model implements a simple scrambler using basic discrete-time signal processing operations of filtering and mod- ulation. You can study the structure of the scrambler by clicking on the Simulink block Scrambler. The scrambler uses lowpass filters with the following specifications (all specifications are with respect to Fs = 16 kHz):
- Passband edge frequency = 3.8 kHz,
- Stopband edge frequency = 4 kHz,
- Stopband attenuation = 80 dB.

You can open the Digital Filter block in the Scrambler model and select the View Filter Response option.

The Scrambler uses a digital oscillator whose output frequency is set to π/2 rad/sec (equivalent to 4 kHz for Fs = 16 kHz).

Study the operation of the Scrambler. How does it alter input signal characteristics? In particular, determine the spectrum of the signal at the output of the scrambler when the input to the scrambler is a baseband signal with bandwidth 4 kHz and a frequency hole from 0 to 0.2 kHz. How would you unscramble a scrambled signal?

(b) Determine the coefficients of FIR and IIR notch filters if the notch filter is to be used to remove all affects of the two noise components at F1 = 0.8 kHz and F2 = 1.2 kHz for the following two cases:
(i) at the input of the scrambler;
(ii) at the output of the scrambler.

Calculate the FIR and IIR filter coefficients for both cases, clearly identify all your assumptions. Compare the magnitude spectra of your analytically determined filters with those from the filters generated by your Matlab function notch.m. Comment on any differences observed. Note: For the IIR notch filters you design, magnitudes of system poles should not exceed 0.95.

(c) Test the effectiveness of your notch filter by implementing it in Simulink. The Digital Filter/Notch Filter block in the Simulink model Scrambler.slx have all its coefficients set to 1 such the output of the Digital Filter/Notch Filter block equals its input.

First enter the notch filter coefficients you calculated in part b-(i) into the Digi- tal Filter/Notch Filter block (double-click on the Digital Filter/Notch Fil- ter block and a dialog box will open). Test your notch first with the noisy non- scrambled signal (sp16 noisy) using the signal flow chain:

Audio Signal Input (sp16 noisy) → Notch Filter → To Audio Device

How does the filtered signal sound? How does the spectrum of the filtered signal com- pare with that of the "clean" signal (sp16)? What are the differences you observe/hear between the FIR notch and IIR notch filters?

(d) Test the effectiveness of your notch filter by testing it on scrambled signal. Using the results you obtained in part (a) create a Descrambler block and incorporate it into your Simulink block. First, test the descrambler using the signal flow chain:

Audio Signal Input (sp16) → Scrambler → Descrambler → To Audio Device

You can now test the effectiveness of the notch filter you designed in part b-(ii) using the scrambled signal xs[n] as its input. In particular, use the signal flow chain:

Audio Signal Input (sp16 noisy) → Scrambler → NotchFilter →

Descrambler → To Audio Device

How does the filtered+descrambled signal sound? How does the spectrum of the filtered+descrambled signal compare with that of the "clean" signal (sp16)? What are the differences you observe/hear between the FIR notch and IIR notch filters?

Remark: The Simulink model Scrambler.slx has its simulation stop time set to 3.5 s which corresponds approximately to the duration of the test signals. If you want to have longer simulation run times, you need to adjust the stop time accordingly. For example, if you change the simulation stop time to Inf, then the simulation will continuously run until you pause or stop it. In this scenario the same 2.5 s long test signal will be cyclicly repeated.

Attachment:- Data Files.zip

Verified Expert

Work is about implementation of filters using MATLAB. The work is done using MATLAB which produces various plots Work is divided in two parts. One is based on MATLAB to dealing to filter designs.Second is based on simulink design which comes with description of design. Again we have coding and graph part in this.

Reference no: EM131541085

Questions Cloud

Wage replacement ratio : Mr. Jones is 40 years old. He wants to retire at age 62 with an 80% wage replacement ratio. Calculate Mr. Jones capital needs at age 40.
What other factors might influence a purchase : What are the steps a buyer passes through when making a buying decision? What other factors might influence a purchase
What the outcome of conducting a market opportunity analysis : What is the outcome of conducting a market opportunity analysis? Examine two components of the MOA and assess how each contributes to an effective IMC
Viewpoint of a leader : Theme One: Understanding the nature of leadership helps to frame the viewpoint of a leader.View: Drew Dudley:
Design an fir filter that eliminates the noise components : Design an FIR filter that eliminates the noise components F1 and F2 - Determine the coefficients of FIR and IIR notch filters
Recreate the requirements gathering process : Recreate the requirements gathering process that could have led to the outdated/bad design of the product.
How might standage respond to this reviewer : Standage not only suggests that "there's nothing new under the sun," but he asserts that we've recently returned to a more democratic.
Describe the typical perpetrator : Describe a criminal behavior in detail addressing how multicultural characteristics might influence the behavior as well as perceptions of the behavior.
Pre-initiating and initiating processes : Identify a project that you worked on in the past (or research one online) and discuss at least four of the key decisions made during the pre-initiating.

Reviews

inf1541085

8/30/2017 5:36:46 AM

Well done guys.. thanks for delivering me a pleasant work. It reduced my workload at university. I exceptionally suggest your site's administrations to all of my friends. The provided codes are fine and according to my requirements.

inf1541085

7/14/2017 4:59:09 AM

THE REPORT MUST INCLUDE THE ANSWERS OF THE QUESTIONS. ONLY MATLAB CODE Preapare a report that incorporates your answers to Problem 2 parts (a){(d). The report must include: analysis of the scrambler and the descrambler; calculated FIR and IIR notch lter coecients; assumptions made while designing the FIR and IIR notch lters; comparison of analytically determined and notch.m generated lters; discussion of the results you obtained while testing the e ectiveness of your analyt- ically determined FIR and IIR notch lters with the Simulink model (supported by appropriate magnitude response functions and signal spectra). I attached sample of the report that should lik the report you send is only matlab code 241.620.94_1Computer Assign 632 3pages.zip

inf1541085

7/14/2017 4:58:00 AM

These are What is under ELE632_Data.mat file 241.620.1_1ps.mat 241.620.1_2sp16 noisy.mat 241.620.31_3sp16.mat the other file need simulink the data files 241.620.53_1ELE632 Data.mat the report has no calculations question 2 need calculation in the report

len1541085

6/23/2017 1:45:55 AM

• Your notch.m code: During the course of this assignment you will write the Matlab function notch.m. This file should be well commented and provide sufficient informa- tion such that a person reading your code can understand the rationale you used in constructing your code.

len1541085

6/23/2017 1:45:48 AM

Ask question #Minimum 100 words accepted#i want to get a qute • Preapare a report that incorporates your answers to Problem 2 parts (a)–(d). The report must include: analysis of the scrambler and the descrambler; calculated FIR and IIR notch filter coefficients; assumptions made while designing the FIR and IIR notch filters; comparison of analytically determined and notch.m generated filters; discussion of the results you obtained while testing the effectiveness of your analyt- ically determined FIR and IIR notch filters with the Simulink model (supported by appropriate magnitude response functions and signal spectra).

Write a Review

Electrical Engineering Questions & Answers

  Lithium ion battery technology

The paper includes Lithium ion battery technology with its advantages and disadvantages. The paper discusses about the Lithium air battery in which detailed reactions of Lithium with air including nonaqueous as well as aqueous are given.

  Power transformers and tariffs

Construction of different types of power transformer, significant energy savings

  Paper on orthogonal frequency-division multiplexing

This document is shown a paper on Orthogonal frequency-division multiplexing with advantages, disadvantages and uses.

  Function of the hmi in a scada system

This assignment contains electronics engineering questions like State the commonly found components of a SCADA (Supervisory control and data acquisition) system. and decribe the function of the HMI in a SCADA system.

  Resultant waveform of the odd harmonic series

Prepare an Excel graph showing the individual components and summated resultant waveform of the odd harmonic series resulting in an approximate square wave.

  Explain scada system

Explain the function of the HMI in a SCADA system.

  Design a 2-digit 24 second shot-clock

Design a 2-digit 24 second "shot-clock" countdown timer with pushbutton controller.

  Model a discrete-time system

To understand di erent signal models To be able to model a discrete-time system and design simple signal processing algorithms.

  Draw a relay construction diagram

Draw a relay construction diagram and briefly explain the operation of a relay.

  Frequency division multiplexing

Write a short technical report on Frequency Division Multiplexing

  Impact of electron energy

Briefly discuss the impact of electron energy, electron current and target on the Bremsstrahlung generated.

  Traffic light controller

The schematic of the traffic light controller

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd