SlideShare a Scribd company logo
1 of 9
Download to read offline
Link to ElecFilDes – The Electronic Filter Design Program referenced herein.
Design and Implement Any Digital Filter in Less than 60 Seconds
Digital filtering is one of the most powerful tools of DSP (digital signal
processing). Apart from the obvious advantages of virtually eliminating errors in
the filter associated with passive component fluctuations over time and
temperature, op amp drift (active filters), etc., digital filters are capable of
performance specifications that would, at best, be extremely difficult, if not
impossible, to achieve with an analog implementation.
Infinite impulse response (IIR) and Finite impulse response (FIR) filters
IIR filters are the most efficient type of digital filter to implement in DSP. They are
usually provided as cascaded 2nd
order (biquad) sections. The IIR filter uses the
previous output values to compute the next output value. The amount of processing
that is required to compute a biquad is relatively small. The biquad can be
implemented by the topology in figure 1.
Figure 1. A single IIR biquad section.
By contrast, FIR filters use only the existing input and stored values of previous
input values. An FIR filter requires more computation time on the DSP and more
memory. FIR filtering can implement linear-phase filtering. This means that the
filter has no phase shift across the frequency band, but has constant group delay.
However, FIRs can be limited in resolution at low frequencies, and the success of
applying FIR filters depends greatly on the program that is used to generate the
filter coefficients. Usage is generally more complicated and time-consuming than
IIR filters.
Figure 2. A FIR filter topology. Each z-1
block represents a delay of one sample
period.
On the MC56F84789VLL digital signal controller (DSC), a 512 tap filter would be
implemented by repeating the following instruction 512 times.
mac y0,x0,a x:(r0)+,y0 x:(r3)+,x0
Register 0 is a pointer to the input sample and delayed input samples. Register 3 is
a pointer to the b(n) coefficients used to multiply the input samples. The output is
the sum of all multiplications.
In the ElecFilDes filter design program, the coefficient resolution is 16 bits for FIR
designs, while 32 bit math is used to generate and process IIR coefficients.
ElecFilDes has a quantization routine that shows the degradation for using 16 bit
math in FIR designs, but the degradation is usually insignificant.
The ElecFilDes software will generate a coefficient file for any FIR and IIR design
within the programs capability. FIR designs are limited to Remez exchange
equiripple, or FIR window, designs with length of 512 taps, or less, and sampling
speeds between 1 to 100,000 samples per second. FIR window designs include
Hamming, Hanning, Rectangular, or Kaiser windows. The IIR designs can
accommodate all filter design options shown in figure 4 with sampling frequency
between 1 to 100,000 samples per second.
Figure 3. MC56F8400 evaluation board for the MC56F84789VLL DSC.
Figure 4. ElecFilDes Initial User Interface Screen. The example shown in figure 4
is for a 20th
order elliptic filter that blocks 2200Hz to 2800Hz and passes all other
frequencies. Simply clicking “Continue” generates the coefficient file which is
then ready to be assembled and downloaded by Codewarrior to the MC56F8400
demo board. The corresponding theoretical response, from ElecFilDes software, is
shown in figure 5.
Figure 5. Bandstop Response
It is interesting to note that removal of this 600Hz range in the audio spectrum is
not immediately apparent by listening to voice, or music.
An implementation block diagram is shown in figure 6.
Figure 6. Block diagram.
Optional Anti-
Aliasing Filter
MC56F84789VLL
based FIR/IIR
digital filter
engine on
MC56F8400
evaluation board
Optional
sin(x)/x DAC
correction filter
Audio
Amplifier
and Speaker
Anti-aliasing Filter:
Unless the user is advanced in using A/D sampling as a means of down conversion
and demodulation, it is advisable to use an analog anti-aliasing lowpass filter that
blocks all frequencies above ½ of the A/D sampling frequency. Frequencies above
½ the sampling rate will “fold over” into the lower frequency spectrum, causing
undesired interference. For a sampling rate of 100,000 Hz, the lowpass anti-
aliasing filter should have at least 40db of attenuation for frequencies above
50KHz. If the source does not contain frequencies above ½ the sampling
frequency, then an anti-aliasing filter is not necessary.
MC56F8400 Evaluation Board:
This board contains the MC56F84789VLL digital signal controller and has a 16-bit
A/D converter and a 12- bit DAC internal to the chip. The A/D converter can run at
100,000 samples per second or one sample every 10 microseconds. A typical
multiply and accumulate (MAC) instruction takes 10 nanoseconds using the DSC
at full speed, allowing for over 500 multiplication and additions within a 10
microsecond timeframe therefore making it possible to implement FIR filters of
up to 512 taps.
The signal at the input to the A/D converter must be up-biased to a 1.65 volt offset
since the A/D converter input range is 0 to 3.3 volts. The DAC output will also be
centered at a 1.65 volt offset, and should be AC coupled before audio
amplification.
Sin(x)/x Correction Filter:
The 12 bit digital-to-analog (DAC) is built into the MC56F84789VLL DSC chip.
All DACs have a frequency response and will attenuate the signal by 0.636 at ½
the sampling rate. For our previous example where the sampling rate was
100,000Hz, and the highest frequency of interest was much less than 50,000Hz, a
sin(x)/x correction filter is unnecessary because the DAC attenuation will be
insignificant.
ElecFilDes Design Program
This program can generate numerous filter designs that are capable of being
assembled within 60 seconds by Codewarrior, and downloaded to the MC56F400
EVB. ElecDesFil uses a proprietary scheme to associate transfer function zeroes
with corresponding poles for each quadratic section in order to minimize limit
cycle oscillations, overshoots, and problems commonly associated with other filter
implementations. However, because the DSC uses only 32 bit fixed point math in
the calculations for IIR filters, the response of some higher order elliptical IIR
filters will not be as sharp as theoretically possible. The program can design
elliptic filters, where the Q of the last stage is over 1,000,000. Implementation of
these filters results in a stable response, but because the Q is so high, and the
calculations use finite precision math, the passband edges will not be as sharp as
predicted. While it is tempting to always use a 20th
order elliptic filter, designs
should be restricted to a filter order that produces only the desired rolloff. High
order audio elliptic filters can also have a group delay extending into the 10’s of
seconds, which means that energy in the digital filter will decay very slowly after
the input signal is removed. The user will notice this as a faint tone that decays
over several seconds, if the filter order is too high.
ElecFilDes has a utility that lets the user determine the required filter order. The
example in figure 7 shows the filter orders necessary to pass 0-5000Hz, but
attenuate all frequencies above 5050Hz by 50dB.
The codewarrior view in figure 8 shows the two files that are required.
MASM.ASM is provided with the ElecDesFil software. During runtime,
MASM.ASM examines the coefficient file, DSPFILTER.ASM to determine if the
coefficients should be processed as an IIR, or FIR, filter. The highlighted “include”
line must be edited to provide the path to the DSPFILTER.ASM coefficient file.
To implement the filter, select PROJECT  CLEAN, followed by RUN 
DEBUG, followed by RUNRESUME. At this point, the design is running in the
DSC on the EVB.
Figure 7. Determination of Required Filter Order
Figure 8. Codewarrior View
Testing of FIR and IIR digital filters was done using a synthesized signal generator
and an oscilloscope to verify stability and timing for all designs. The demo setup,
used by the author, in figure 9, does not have an anti-aliasing filter, nor a DAC
sin(x)/x correction filter. The audio source is an FM radio, and the output of the
MC56F400 EVB is fed directly into an audio amplifier. A custom interface board
was used to interface to the EVB with the schematic shown in figure 10. The DSC
has an internal R-C oscillator and the frequency of this oscillator must be trimmed
by register control so that passband edges are accurate. A crystal oscillator option
is available, but uninstalled, if the EVB is purchased directly from Freescale.
Figure 9. Final Verification Station
For the circuit in figure 10, a custom modification on shorting pins 1 and 2 on J7
was made in able to provide 3.3 volts from the EVB to the interface board. The
EVB connects to a laptop through USB interface, for power and programming.
On the interface board, R2 and R3 are used to generate 1.65 volts to center the A/D
input. C1 forms a high pass filter to block any dc component from the input. C2 is
used to filter any power supply noise on the R2/R3 voltage divider that comes from
the 3.3 volts on the EVB. R1 injects the 1.65 volts onto the AC coupled input
signal without loading down the input source, and R4 provides current limiting
protection to the input of the A/D converter.
On the output side, R6 is used to eliminate hum during reset of the MC56F400
EVB when the DAC output goes into its high impedance state. R5 is to provide
current limiting protection to the DAC output.
While running, a small amount of 60Hz hum might be noticed. This can be
resolved by unplugging the power from the laptop running Codewarrior, so that the
laptop then becomes battery powered, thus eliminating the ground loop.
Figure 10. Custom Interface Board shown under the MC56F8400 EVB in figure 9.
R4 1K
A/D Input to Pin 38 of J501
C1
22uf
J4
Phono Connector
1
2
R3
1K
Audio
Output
DAC Output
C2
0.1uf
From Pin 21 of J502
J3
BNC
1
2
J1
BNC
1
2
R2
1K
R6
1K
R1
1K
R5 1K
J2
Phono Connector
1
2
From Pin 14 of J502
Audio
Input
From Pin 40 of J501
+3.3V

More Related Content

What's hot

Multiband Transceivers - [Chapter 5] Software-Defined Radios
Multiband Transceivers - [Chapter 5]  Software-Defined RadiosMultiband Transceivers - [Chapter 5]  Software-Defined Radios
Multiband Transceivers - [Chapter 5] Software-Defined RadiosSimen Li
 
Rf receiver design case studies
Rf receiver design case studiesRf receiver design case studies
Rf receiver design case studiesPhani Kumar
 
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR) Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR) Chandrashekhar Padole
 
FPGA Implementation of ADPLL with Ripple Reduction Techniques
FPGA Implementation of ADPLL with Ripple Reduction TechniquesFPGA Implementation of ADPLL with Ripple Reduction Techniques
FPGA Implementation of ADPLL with Ripple Reduction TechniquesVLSICS Design
 
Multi band, multi mode digital rf receiver front end module for m-wimax
Multi band, multi mode digital rf receiver front end module for m-wimaxMulti band, multi mode digital rf receiver front end module for m-wimax
Multi band, multi mode digital rf receiver front end module for m-wimaxeSAT Publishing House
 
Wireless RF Module Using PIC MCU (Slides).
Wireless RF Module Using PIC MCU (Slides).Wireless RF Module Using PIC MCU (Slides).
Wireless RF Module Using PIC MCU (Slides).Abee Sharma
 
Basics of digital filters
Basics of digital filtersBasics of digital filters
Basics of digital filtersSmile Hossain
 
10.1.1.399.4069
10.1.1.399.406910.1.1.399.4069
10.1.1.399.4069Cut Lilis
 
Data Converters in SDR Platforms
Data Converters in SDR PlatformsData Converters in SDR Platforms
Data Converters in SDR Platformsidescitation
 
Integrated Software Defined Radio (Design Conference 2013)
Integrated Software Defined Radio (Design Conference 2013)Integrated Software Defined Radio (Design Conference 2013)
Integrated Software Defined Radio (Design Conference 2013)Analog Devices, Inc.
 
K3 Power Point
K3 Power PointK3 Power Point
K3 Power PointSil
 
Iisrt z pranoti kumbhare
Iisrt z pranoti kumbhareIisrt z pranoti kumbhare
Iisrt z pranoti kumbhareIISRT
 
RF transmitter & receiver
RF transmitter & receiverRF transmitter & receiver
RF transmitter & receivercodexdesign
 
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMS
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMSDESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMS
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMSVLSICS Design
 

What's hot (19)

General/Digital up conversion
General/Digital up conversionGeneral/Digital up conversion
General/Digital up conversion
 
Multiband Transceivers - [Chapter 5] Software-Defined Radios
Multiband Transceivers - [Chapter 5]  Software-Defined RadiosMultiband Transceivers - [Chapter 5]  Software-Defined Radios
Multiband Transceivers - [Chapter 5] Software-Defined Radios
 
Rf receiver design case studies
Rf receiver design case studiesRf receiver design case studies
Rf receiver design case studies
 
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR) Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)
 
FFaraji
FFarajiFFaraji
FFaraji
 
RF Transceivers
RF TransceiversRF Transceivers
RF Transceivers
 
Fc36951956
Fc36951956Fc36951956
Fc36951956
 
FPGA Implementation of ADPLL with Ripple Reduction Techniques
FPGA Implementation of ADPLL with Ripple Reduction TechniquesFPGA Implementation of ADPLL with Ripple Reduction Techniques
FPGA Implementation of ADPLL with Ripple Reduction Techniques
 
Multi band, multi mode digital rf receiver front end module for m-wimax
Multi band, multi mode digital rf receiver front end module for m-wimaxMulti band, multi mode digital rf receiver front end module for m-wimax
Multi band, multi mode digital rf receiver front end module for m-wimax
 
Wireless RF Module Using PIC MCU (Slides).
Wireless RF Module Using PIC MCU (Slides).Wireless RF Module Using PIC MCU (Slides).
Wireless RF Module Using PIC MCU (Slides).
 
Basics of digital filters
Basics of digital filtersBasics of digital filters
Basics of digital filters
 
digital filters
digital filtersdigital filters
digital filters
 
10.1.1.399.4069
10.1.1.399.406910.1.1.399.4069
10.1.1.399.4069
 
Data Converters in SDR Platforms
Data Converters in SDR PlatformsData Converters in SDR Platforms
Data Converters in SDR Platforms
 
Integrated Software Defined Radio (Design Conference 2013)
Integrated Software Defined Radio (Design Conference 2013)Integrated Software Defined Radio (Design Conference 2013)
Integrated Software Defined Radio (Design Conference 2013)
 
K3 Power Point
K3 Power PointK3 Power Point
K3 Power Point
 
Iisrt z pranoti kumbhare
Iisrt z pranoti kumbhareIisrt z pranoti kumbhare
Iisrt z pranoti kumbhare
 
RF transmitter & receiver
RF transmitter & receiverRF transmitter & receiver
RF transmitter & receiver
 
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMS
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMSDESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMS
DESIGN AND ASIC IMPLEMENTATION OF DUC/DDC FOR COMMUNICATION SYSTEMS
 

Viewers also liked

Audio components-things-you-should-know-before-installing-any-audio-system
Audio components-things-you-should-know-before-installing-any-audio-systemAudio components-things-you-should-know-before-installing-any-audio-system
Audio components-things-you-should-know-before-installing-any-audio-systemblogroyaltyuniverse
 
FoundationsofAudio_EQandFilters_CertificateOfCompletion
FoundationsofAudio_EQandFilters_CertificateOfCompletionFoundationsofAudio_EQandFilters_CertificateOfCompletion
FoundationsofAudio_EQandFilters_CertificateOfCompletionZack Logan
 
Fir filter design (windowing technique)
Fir filter design (windowing technique)Fir filter design (windowing technique)
Fir filter design (windowing technique)Bin Biny Bino
 
Fir and iir filter_design
Fir and iir filter_designFir and iir filter_design
Fir and iir filter_designshrinivasgnaik
 
Basic computer configuration setup
Basic computer configuration setupBasic computer configuration setup
Basic computer configuration setupRachel Espino
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filtersop205
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filtersop205
 

Viewers also liked (13)

Audio components-things-you-should-know-before-installing-any-audio-system
Audio components-things-you-should-know-before-installing-any-audio-systemAudio components-things-you-should-know-before-installing-any-audio-system
Audio components-things-you-should-know-before-installing-any-audio-system
 
FoundationsofAudio_EQandFilters_CertificateOfCompletion
FoundationsofAudio_EQandFilters_CertificateOfCompletionFoundationsofAudio_EQandFilters_CertificateOfCompletion
FoundationsofAudio_EQandFilters_CertificateOfCompletion
 
Basic audio programming
Basic audio programmingBasic audio programming
Basic audio programming
 
Signals
SignalsSignals
Signals
 
Fir filter design (windowing technique)
Fir filter design (windowing technique)Fir filter design (windowing technique)
Fir filter design (windowing technique)
 
Electronics ..
Electronics ..Electronics ..
Electronics ..
 
Fir and iir filter_design
Fir and iir filter_designFir and iir filter_design
Fir and iir filter_design
 
Basic computer configuration setup
Basic computer configuration setupBasic computer configuration setup
Basic computer configuration setup
 
Digital audio
Digital audioDigital audio
Digital audio
 
Active Filter (Low Pass)
Active Filter (Low Pass)Active Filter (Low Pass)
Active Filter (Low Pass)
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filters
 
Filters
FiltersFilters
Filters
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filters
 

Similar to Design and Implement Any Digital Filters in Less than 60 Seconds

Matlab Based Decimeter Design Analysis Wimax Appliacation
Matlab Based Decimeter Design Analysis Wimax AppliacationMatlab Based Decimeter Design Analysis Wimax Appliacation
Matlab Based Decimeter Design Analysis Wimax Appliacationiosrjce
 
Design of Low Power Sigma Delta ADC
Design of Low Power Sigma Delta ADCDesign of Low Power Sigma Delta ADC
Design of Low Power Sigma Delta ADCVLSICS Design
 
Types Of Window Being Used For The Selected Granule
Types Of Window Being Used For The Selected GranuleTypes Of Window Being Used For The Selected Granule
Types Of Window Being Used For The Selected GranuleLeslie Lee
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Discrete time signal processing unit-2
Discrete time signal processing unit-2Discrete time signal processing unit-2
Discrete time signal processing unit-2selvalakshmi24
 
FIR_Filters_with_FPGA
FIR_Filters_with_FPGAFIR_Filters_with_FPGA
FIR_Filters_with_FPGAIrvn Rynning
 
DickeyS_presentation_2015_3_26_2_1
DickeyS_presentation_2015_3_26_2_1DickeyS_presentation_2015_3_26_2_1
DickeyS_presentation_2015_3_26_2_1Sergey Dickey
 
Design and ASIC Implemenatation of DUC/DDC for Communication Systems
Design and ASIC Implemenatation of DUC/DDC for Communication Systems  Design and ASIC Implemenatation of DUC/DDC for Communication Systems
Design and ASIC Implemenatation of DUC/DDC for Communication Systems VLSICS Design
 
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...idescitation
 
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemVoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemSagun Man Singh Shrestha
 
10.1.1.399.4069
10.1.1.399.406910.1.1.399.4069
10.1.1.399.4069Cut Lilis
 
Abhinav End Sem Presentation Software Defined Radio
Abhinav End Sem Presentation Software Defined RadioAbhinav End Sem Presentation Software Defined Radio
Abhinav End Sem Presentation Software Defined Radioguestad4734
 
ADF7021 High Performance Narrowband ISM Transceiver
ADF7021 High Performance Narrowband ISM TransceiverADF7021 High Performance Narrowband ISM Transceiver
ADF7021 High Performance Narrowband ISM TransceiverPremier Farnell
 
Sinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxSinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxjennifer822
 
Efficient signal acquisition in multi channel neural systems
Efficient signal acquisition in multi channel neural systemsEfficient signal acquisition in multi channel neural systems
Efficient signal acquisition in multi channel neural systemsAshwath Krishnan
 
Solution on Handheld Signal Generator
Solution on Handheld Signal Generator Solution on Handheld Signal Generator
Solution on Handheld Signal Generator Premier Farnell
 

Similar to Design and Implement Any Digital Filters in Less than 60 Seconds (20)

J017635664
J017635664J017635664
J017635664
 
Matlab Based Decimeter Design Analysis Wimax Appliacation
Matlab Based Decimeter Design Analysis Wimax AppliacationMatlab Based Decimeter Design Analysis Wimax Appliacation
Matlab Based Decimeter Design Analysis Wimax Appliacation
 
Design of Low Power Sigma Delta ADC
Design of Low Power Sigma Delta ADCDesign of Low Power Sigma Delta ADC
Design of Low Power Sigma Delta ADC
 
Types Of Window Being Used For The Selected Granule
Types Of Window Being Used For The Selected GranuleTypes Of Window Being Used For The Selected Granule
Types Of Window Being Used For The Selected Granule
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
F0213137
F0213137F0213137
F0213137
 
FPGA Implementation of High Speed FIR Filters and less power consumption stru...
FPGA Implementation of High Speed FIR Filters and less power consumption stru...FPGA Implementation of High Speed FIR Filters and less power consumption stru...
FPGA Implementation of High Speed FIR Filters and less power consumption stru...
 
Discrete time signal processing unit-2
Discrete time signal processing unit-2Discrete time signal processing unit-2
Discrete time signal processing unit-2
 
FIR_Filters_with_FPGA
FIR_Filters_with_FPGAFIR_Filters_with_FPGA
FIR_Filters_with_FPGA
 
DickeyS_presentation_2015_3_26_2_1
DickeyS_presentation_2015_3_26_2_1DickeyS_presentation_2015_3_26_2_1
DickeyS_presentation_2015_3_26_2_1
 
Design and ASIC Implemenatation of DUC/DDC for Communication Systems
Design and ASIC Implemenatation of DUC/DDC for Communication Systems  Design and ASIC Implemenatation of DUC/DDC for Communication Systems
Design and ASIC Implemenatation of DUC/DDC for Communication Systems
 
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...
FPGA Implementation of Optimized CIC Filter for Sample Rate Conversion in Sof...
 
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemVoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
 
10.1.1.399.4069
10.1.1.399.406910.1.1.399.4069
10.1.1.399.4069
 
Abhinav End Sem Presentation Software Defined Radio
Abhinav End Sem Presentation Software Defined RadioAbhinav End Sem Presentation Software Defined Radio
Abhinav End Sem Presentation Software Defined Radio
 
ADF7021 High Performance Narrowband ISM Transceiver
ADF7021 High Performance Narrowband ISM TransceiverADF7021 High Performance Narrowband ISM Transceiver
ADF7021 High Performance Narrowband ISM Transceiver
 
Sinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docxSinewave Generation 1. Problem Statement The goal of t.docx
Sinewave Generation 1. Problem Statement The goal of t.docx
 
Efficient signal acquisition in multi channel neural systems
Efficient signal acquisition in multi channel neural systemsEfficient signal acquisition in multi channel neural systems
Efficient signal acquisition in multi channel neural systems
 
Solution on Handheld Signal Generator
Solution on Handheld Signal Generator Solution on Handheld Signal Generator
Solution on Handheld Signal Generator
 
A 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADCA 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADC
 

Design and Implement Any Digital Filters in Less than 60 Seconds

  • 1. Link to ElecFilDes – The Electronic Filter Design Program referenced herein. Design and Implement Any Digital Filter in Less than 60 Seconds Digital filtering is one of the most powerful tools of DSP (digital signal processing). Apart from the obvious advantages of virtually eliminating errors in the filter associated with passive component fluctuations over time and temperature, op amp drift (active filters), etc., digital filters are capable of performance specifications that would, at best, be extremely difficult, if not impossible, to achieve with an analog implementation. Infinite impulse response (IIR) and Finite impulse response (FIR) filters IIR filters are the most efficient type of digital filter to implement in DSP. They are usually provided as cascaded 2nd order (biquad) sections. The IIR filter uses the previous output values to compute the next output value. The amount of processing that is required to compute a biquad is relatively small. The biquad can be implemented by the topology in figure 1. Figure 1. A single IIR biquad section. By contrast, FIR filters use only the existing input and stored values of previous input values. An FIR filter requires more computation time on the DSP and more memory. FIR filtering can implement linear-phase filtering. This means that the filter has no phase shift across the frequency band, but has constant group delay. However, FIRs can be limited in resolution at low frequencies, and the success of applying FIR filters depends greatly on the program that is used to generate the
  • 2. filter coefficients. Usage is generally more complicated and time-consuming than IIR filters. Figure 2. A FIR filter topology. Each z-1 block represents a delay of one sample period. On the MC56F84789VLL digital signal controller (DSC), a 512 tap filter would be implemented by repeating the following instruction 512 times. mac y0,x0,a x:(r0)+,y0 x:(r3)+,x0 Register 0 is a pointer to the input sample and delayed input samples. Register 3 is a pointer to the b(n) coefficients used to multiply the input samples. The output is the sum of all multiplications. In the ElecFilDes filter design program, the coefficient resolution is 16 bits for FIR designs, while 32 bit math is used to generate and process IIR coefficients. ElecFilDes has a quantization routine that shows the degradation for using 16 bit math in FIR designs, but the degradation is usually insignificant. The ElecFilDes software will generate a coefficient file for any FIR and IIR design within the programs capability. FIR designs are limited to Remez exchange equiripple, or FIR window, designs with length of 512 taps, or less, and sampling speeds between 1 to 100,000 samples per second. FIR window designs include Hamming, Hanning, Rectangular, or Kaiser windows. The IIR designs can accommodate all filter design options shown in figure 4 with sampling frequency between 1 to 100,000 samples per second.
  • 3. Figure 3. MC56F8400 evaluation board for the MC56F84789VLL DSC. Figure 4. ElecFilDes Initial User Interface Screen. The example shown in figure 4 is for a 20th order elliptic filter that blocks 2200Hz to 2800Hz and passes all other
  • 4. frequencies. Simply clicking “Continue” generates the coefficient file which is then ready to be assembled and downloaded by Codewarrior to the MC56F8400 demo board. The corresponding theoretical response, from ElecFilDes software, is shown in figure 5. Figure 5. Bandstop Response It is interesting to note that removal of this 600Hz range in the audio spectrum is not immediately apparent by listening to voice, or music. An implementation block diagram is shown in figure 6. Figure 6. Block diagram. Optional Anti- Aliasing Filter MC56F84789VLL based FIR/IIR digital filter engine on MC56F8400 evaluation board Optional sin(x)/x DAC correction filter Audio Amplifier and Speaker
  • 5. Anti-aliasing Filter: Unless the user is advanced in using A/D sampling as a means of down conversion and demodulation, it is advisable to use an analog anti-aliasing lowpass filter that blocks all frequencies above ½ of the A/D sampling frequency. Frequencies above ½ the sampling rate will “fold over” into the lower frequency spectrum, causing undesired interference. For a sampling rate of 100,000 Hz, the lowpass anti- aliasing filter should have at least 40db of attenuation for frequencies above 50KHz. If the source does not contain frequencies above ½ the sampling frequency, then an anti-aliasing filter is not necessary. MC56F8400 Evaluation Board: This board contains the MC56F84789VLL digital signal controller and has a 16-bit A/D converter and a 12- bit DAC internal to the chip. The A/D converter can run at 100,000 samples per second or one sample every 10 microseconds. A typical multiply and accumulate (MAC) instruction takes 10 nanoseconds using the DSC at full speed, allowing for over 500 multiplication and additions within a 10 microsecond timeframe therefore making it possible to implement FIR filters of up to 512 taps. The signal at the input to the A/D converter must be up-biased to a 1.65 volt offset since the A/D converter input range is 0 to 3.3 volts. The DAC output will also be centered at a 1.65 volt offset, and should be AC coupled before audio amplification. Sin(x)/x Correction Filter: The 12 bit digital-to-analog (DAC) is built into the MC56F84789VLL DSC chip. All DACs have a frequency response and will attenuate the signal by 0.636 at ½ the sampling rate. For our previous example where the sampling rate was 100,000Hz, and the highest frequency of interest was much less than 50,000Hz, a sin(x)/x correction filter is unnecessary because the DAC attenuation will be insignificant.
  • 6. ElecFilDes Design Program This program can generate numerous filter designs that are capable of being assembled within 60 seconds by Codewarrior, and downloaded to the MC56F400 EVB. ElecDesFil uses a proprietary scheme to associate transfer function zeroes with corresponding poles for each quadratic section in order to minimize limit cycle oscillations, overshoots, and problems commonly associated with other filter implementations. However, because the DSC uses only 32 bit fixed point math in the calculations for IIR filters, the response of some higher order elliptical IIR filters will not be as sharp as theoretically possible. The program can design elliptic filters, where the Q of the last stage is over 1,000,000. Implementation of these filters results in a stable response, but because the Q is so high, and the calculations use finite precision math, the passband edges will not be as sharp as predicted. While it is tempting to always use a 20th order elliptic filter, designs should be restricted to a filter order that produces only the desired rolloff. High order audio elliptic filters can also have a group delay extending into the 10’s of seconds, which means that energy in the digital filter will decay very slowly after the input signal is removed. The user will notice this as a faint tone that decays over several seconds, if the filter order is too high. ElecFilDes has a utility that lets the user determine the required filter order. The example in figure 7 shows the filter orders necessary to pass 0-5000Hz, but attenuate all frequencies above 5050Hz by 50dB. The codewarrior view in figure 8 shows the two files that are required. MASM.ASM is provided with the ElecDesFil software. During runtime, MASM.ASM examines the coefficient file, DSPFILTER.ASM to determine if the coefficients should be processed as an IIR, or FIR, filter. The highlighted “include” line must be edited to provide the path to the DSPFILTER.ASM coefficient file. To implement the filter, select PROJECT  CLEAN, followed by RUN  DEBUG, followed by RUNRESUME. At this point, the design is running in the DSC on the EVB.
  • 7. Figure 7. Determination of Required Filter Order Figure 8. Codewarrior View
  • 8. Testing of FIR and IIR digital filters was done using a synthesized signal generator and an oscilloscope to verify stability and timing for all designs. The demo setup, used by the author, in figure 9, does not have an anti-aliasing filter, nor a DAC sin(x)/x correction filter. The audio source is an FM radio, and the output of the MC56F400 EVB is fed directly into an audio amplifier. A custom interface board was used to interface to the EVB with the schematic shown in figure 10. The DSC has an internal R-C oscillator and the frequency of this oscillator must be trimmed by register control so that passband edges are accurate. A crystal oscillator option is available, but uninstalled, if the EVB is purchased directly from Freescale. Figure 9. Final Verification Station
  • 9. For the circuit in figure 10, a custom modification on shorting pins 1 and 2 on J7 was made in able to provide 3.3 volts from the EVB to the interface board. The EVB connects to a laptop through USB interface, for power and programming. On the interface board, R2 and R3 are used to generate 1.65 volts to center the A/D input. C1 forms a high pass filter to block any dc component from the input. C2 is used to filter any power supply noise on the R2/R3 voltage divider that comes from the 3.3 volts on the EVB. R1 injects the 1.65 volts onto the AC coupled input signal without loading down the input source, and R4 provides current limiting protection to the input of the A/D converter. On the output side, R6 is used to eliminate hum during reset of the MC56F400 EVB when the DAC output goes into its high impedance state. R5 is to provide current limiting protection to the DAC output. While running, a small amount of 60Hz hum might be noticed. This can be resolved by unplugging the power from the laptop running Codewarrior, so that the laptop then becomes battery powered, thus eliminating the ground loop. Figure 10. Custom Interface Board shown under the MC56F8400 EVB in figure 9. R4 1K A/D Input to Pin 38 of J501 C1 22uf J4 Phono Connector 1 2 R3 1K Audio Output DAC Output C2 0.1uf From Pin 21 of J502 J3 BNC 1 2 J1 BNC 1 2 R2 1K R6 1K R1 1K R5 1K J2 Phono Connector 1 2 From Pin 14 of J502 Audio Input From Pin 40 of J501 +3.3V