Docsity

Filter Design with SP Tool-Digital Signal Processing-Lab Mannual, Exercises of Digital Signal Processing

Toggle sidebar
bg1
Digital Signal Processing Lab
2
Filter Design with SPTool
1. Objective
1.1 Importing and naming a signal using SPTool
1.2 Designing a filter using the Filter Designer
1.3 In SPTool, applying the filter to the signal to create another signal
1.4 Viewing the time domain information of the original and filtered signals using the Signal
Browser
1.5 Comparing the spectra of both signals using the Spectrum Viewer
2. Overview
SPTool is a com plete GUI-based interactive t ool to design and im plement digital filters.
It combines with a set of tools to perf orm the all steps of designing and analyzing the signal and
filter in both frequency and time domains.
2.1 Create, Import, and Name a Signal
You can im port an existing signal into SPT ool, or you can create a new signal and edit
and nam e it in SPTool. In this step, you’ll cr eate a new signal at the com mand line and then
import it into SPTool.
1. At the command line, create a speech signal
[speech,fs]=wavread(‘sppech.wav’);
2. Activate SPTool by typing
sptool
The SPTool window is displayed.
3. Select Import... from the File menu:
The Import to SPTool window is displayed.
Notice that the variable x is displayed in the Workspace Contents list. (If it is not,
click the From Workspace radio button to display the contents of the workspace.)
4. Name the signal and import it into SPTool:
a) Make sure that Signal is selected in the Import As pop-up menu.
b) Click in the Data field and type speech.
You can also move the variable speech into the Data field by clicking on speech in
the Workspace Contents list and then clicking on the arrow to the left of the Data
field.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Filter Design with SP Tool-Digital Signal Processing-Lab Mannual and more Exercises Digital Signal Processing in PDF only on Docsity!

Filter Design with SPTool

1. Objective

1.1 Importing and naming a signal using SPTool 1.2 Designing a filter using the Filter Designer 1.3 In SPTool, applying the filter to the signal to create another signal 1.4 Viewing the time domain information of the original and filtered signals using the Signal Browser 1.5 Comparing the spectra of both signals using the Spectrum Viewer

2. Overview

SPTool is a com plete GUI-based interactive tool to design and im plement digital f ilters. It combines with a set of tools to perform theall steps of designing and analyzing the signal and filter in both frequency and time domains. 2.1 Create, Import, and Name a Signal You can im port an existing signal into SPTool, or you can create a new signal and edit and nam e it in SPTool. In this step, you’ll create a new signal at the com mand line and then import it into SPTool.

  1. At the command line, create a speech signal [speech,fs]=wavread(‘sppech.wav’);
  2. Activate SPTool by typing sptool The SPTool window is displayed.
  3. Select Import... from the File menu: The Import to SPTool window is displayed. Notice that the variable x is displayed in the Workspace Contents list. (If it is not, click the From Workspace radio button to display the contents of the workspace.)
  4. Name the signal and import it into SPTool: a) Make sure that Signal is selected in the Import As pop-up menu. b) Click in the Data field and type speech. You can also move the variable speech into the Data field by clicking on speech in the Workspace Contents list and then clicking on the arrow to the left of the Data field.

c) Similarly Sampling Frequency field provide fs from workspace. d) Name the signal by clicking in the Name field and typing speech. e) Press OK. The SPTool window is reactivated, and the signal speech[vector] is selected in the Signals list.

2.2 Design a Filter You can im port an existing filter into SPTool, or you can design and edit a new filter using the Filter Designer. In this step, you’ll create a new filter. You will start designing by

taking one pole at origin and zero at π. Which is a basic example covered in lecture.

  1. Press New Design in SPTool to activate the Filter Designer and generate a def ault filter.
  2. The Filter Designer window is displayed with the default filter filt1.
  3. Change the filter sampling frequency to fs by typing fs in the Sampling Frequency text box in the Filter Designer.
  4. Specify the filter parameters: a. Make sure Pole/zero editor is selected in the Algorithm pop-up menu. b. Now, firstly clear al zeros and poles from already designed filter. c. Place one zero with mag = 0.9 & angle=pi and a pole mag & angle = 0 Now, you have designed a simple filter. d. Click the send back button. Now it is ready for analysis in SPTool main menu.

You can view and print the tim e dom ain inform ation of the signals using the Signal Browser. You can also play the signals. In this step, you’ll display both signals in the Signal Browser, select and play each signal:

  1. Shift + click on the speech and filsp signals in the Signals list of SPTool to select both signals.
  2. Press View in the Signals panel.
  3. The signal that’s displayed in the Selection pop-up menu and in the
  4. Selection display is the active signal. When you select Play. 2.5 Compare Spectra of Both Signals You can get an idea of the frequency content of the two signals by displaying their power spectra using the Spectrum Viewer, as described below:
  5. Reactivate SPTool by selecting it from the Window menu of the Signal Browser.
  6. Click on the speech[vector] signal in the Signals list of SPTool to select it.
  7. Press Create in the Spectra panel. The Spectrum Viewer is activated, and a spectrum object (spect1) corresponding to the noise signal is created in the Spectra list. Choose FFT in method menu. And type 2048 in Nfft. The spectrum is not computed or displayed yet.
  8. Press Apply in the Spectrum Viewer to compute and display spect1. The spectrum of the speech signal is displayed in the main axes display area.

3. Filter design with θ

In designing a filter to stop a specific frequency component we select θ according to the sampling rate using following table

θ Fs 0 0 pi/4 Fs/ pi/2 Fs/ 3*pi/4 3Fs/ pi Fs/

4. Exercise

  1. Generate sine waves of 1, 2 & 3 KHz at following sampling rate of 12 KHz.
  2. Add them together.
  3. Design a filter using pole zero editor in SPTool which blocks all the generated waves of 1, 2 & 3 KHz. (Hint: use conjugate pair of zeros).
  4. Read a speech Signal.
  5. Design different filters with following configurations in SPTool Æ Filter Designer. All zeros and poles are in conjugate pair. Zeros Poles Magnitude (r) (^) Angle θ Magnitude (r) (^) Angle θ Filter 1 1. 0.

3*pi/ pi/

Filter 2

3*pi/ pi/

  1. Observe the changes in spectrum and comment.
  2. Change the magnitude of pole in both the filter design from zeroÆ0.5 (use conjugate pair of poles).
  3. Change the angle of pair of poles from zeroÆpi/3.
  4. Observe the changes in step 7, 8 and comment.