<< Chapter < Page Chapter >> Page >

Fir filter design

Now we will design an FIR filter using the same LabVIEW DFD toolkit used for the IIR filters. This LabVIEW DFDtoolkit designs 3 different types of FIR filters: Kaiser-Window filters, Equi-Ripple filters and Dolph-Chevyshev Windows filters.We will focus on the Kaiser-Window FIR filters.

  • Open LabVIEW (not the Embedded Edition) and create a New Blank VI.
  • In the block diagram, place the All Functions»Digital Filter Design»Filter Design»DFD Classical Filter Design Express VI.
  • Double click in the VI and configure a lowpass FIR filter with the following settings:
    • Type: Lowpass
    • Passband edge frequency: 400 Hz
    • Stopband edge frequency: 800 Hz
    • Passband ripple: 1dB (doesn’t matter because stopband specs will determine passband ripple)
    • Minimum stopband attenuation: 40 dB
    • Sampling Frequency: 8000 Hz.
    • Design Method: Kaiser Window
  • Once you have all the parameters set correctly, press OK.
  • Place the DFD Save to File VI found in All Functions»Digital Filter Design»Utilities.
  • Wire the filter out to the filter in of the DFD Save to File function. Wire the error clusters.
  • Save the VI in Desktop \ ee 453 \<folder name>using some meaningful title such as Filter Design.vi.
  • Run the VI and when prompted save the Filter Coefficients into the same folder with a meaningful name such as LPFIR400.fds.Make sure to use the default extension (fds) when saving this coefficient file.

    Determine the predicted filter length M using the Kaiser-window design equation:

    Kaiser-window Design Equation

    Recall that alpha is the desired stopband attenuation and delta-omega is the transition region width (in radians/sample). (Show your work.)

    Got questions? Get instant answers now!

    Write down the filter length as calculated by Hypersignal. Does it agree (or come close to) the value predicted above?

    Got questions? Get instant answers now!
  • Close LabVIEW and open LabVIEW Embedded Edition. Target the SPEEDY-33 and open the VI we built in the System Setup section ofthis Lab (lab3setup.vi).
  • Add two more Waveform Graphs on the Front Panel and label them as Time Domain–Filtered and Frequency Domain-Filtered.
  • Add to the DFD Filter VI (All Functions»Signal Processing»Filters) to the Block Diagram after the Add function.Wire the output of the Add function to the DFD filter. Wire the output of the DFD filter to the Analog Output node. Wire the outputof the DFD filter to the Time Domain – Filtered terminal.
  • Make a copy of the Spectral Measurements Express VI. Wire the output of the Add function to the copy of the SpectralMeasurements. Then wire the output of the Power Spectrum to the Frequency Domain – Filtered terminal.
  • Double click on the DFD Filter VI and select the path to the Coefficient File. As soon as you load the file, you will see themagnitude, impulse and phase response graphs update.
  • Save the VI. Start the CD Player and then Run the VI. You should here a heavily lowpass filtered version of your musicthrough the headphones. You can also see the effect of the filtering by looking at the appropriate indicators.
  • Stop the VI and, without changing anything else, change the Sample Rate in the Analog Input node to 18000 Hz. Save and Run theVI and listen to the output now. When done, change the Sample Rate back to 8000 Hz. Save the VI.

    What happens when the sampling frequency used to operate the filter is changed from Fs = 8000 Hz (the Fs used to design the filter) to Fs = 16000 Hz.? Explain

    Got questions? Get instant answers now!
  • Stop the VI and disconnect the Analog Input node and the Add function. Replace these objects with the Simulate Signal Express VI(Functions»Embedded Signal Generator). Double click to bring up the properties page and configure it to generate a 200 Hz sine wavewith amplitude 10000. Set the framesize to 256. Make sure that the sampling frequency is 8000 Hz. Save the VI with a different name.Run the VI and observe the filtered output. Use the Time-Domain plot to carefully measure the amplitude of the outputsignal.
  • Repeat step 16 without changing the name of the file for the following frequencies: 400 Hz, 600 Hz, 800 Hz.

    Complete the following table based on your measured data:

    Table for collecting data
    Got questions? Get instant answers now!

    Does this filter yield the gains that you expected at the frequencies above? Why or why not? Specifically comment on the gain at 400 Hz, 600 Hz and 800 Hz.

    Got questions? Get instant answers now!
  • Set the Simulate Signal back to 200 Hz. Now run the VI and stop it. Because the 200 Hz is in the passband of the filter, theoutput of the filter will look like the input, except for a time delay. Carefully measure and record the time (in milliseconds) ofthe first zero crossing in the input signal and the corresponding zero crossing in the output signal.

    Record the time delay (in milliseconds) between the input and output signal. Convert this to a sample delay (by multiplying time delay by Fs) and compare it to the theoretically expected answer. Discuss.

    Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Fundamentals of digital signal processing lab. OpenStax CNX. Jan 03, 2006 Download for free at http://cnx.org/content/col10303/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Fundamentals of digital signal processing lab' conversation and receive update notifications?

Ask