<< Chapter < Page Chapter >> Page >
You will implement a fourth-order, elliptical, low-pass infinite impulse-response (IIR) filter as a cascade of two second-order sections.

Overview

In this lab, you implement a fourth-order IIR filter completely in fixed-point C. While programming in C provides ease of coding, portability, and comprehension, fixed-point processing raises a few challenges that were handled automatically in assembly. In particular, it is the programmer's responsibility to explicitly handle overflow errors and accumulator sizing.

On the DSP, you will write and test the C function for the elliptic low-pass filter designed from Prelab (Part 1) . You should not try to implement the notch filter designed in Prelab (Part 2) , because it will not work correctly when implemented using Direct Form II. (Why not?)

To implement the fourth-order filter, start with a single set of second-order coefficients and implement a single second-order section. A suggested outline of the implementation steps are:

  1. On paper, design the algorithm for a modular implementation of a single second-order section.
  2. Write the algorithm in C, handling truncation, overflow, saturation, and accumulator sizing.
  3. Verify functionality of this single bi-quad using the frequency sweep test-vector, and the function generator/oscilloscope.
  4. In Matlab, pair the poles and zeros to maximize the gain factors for each section, and on the DSP, verify the correct operation of each bi-quad independently.
  5. Finally, write C code to implement the cascade. The modular design of the second-order section should convince you of the benefits of C programming.

Part 1: design on paper

The first step, and the majority of the work, is to implement a single second-order section, which was shown in Figure 1 . Before writing in C, carefully design and plan out the algorithm on paper in pseudo-code. For an example of how pseudo-code is used to implement an FIR filter, see this link FIR filter implementation.

From your design, you should have a very clear idea about:

  • the chronological order of how the intermediate states {w[n], w[n-1], w[n-2]}, and the output, y[n]should be updated.
  • how pointers or data should move after sample x[n] has been processed, but before x[n+1]comes in.
  • the data types required for all buffers, accumulators, and temporary variables you may need.

Which buffer should be circularly addressed: coefficients or state buffer?

The intermediate state buffer. If you do not clearly understand why, go back to Figure 1 and spend more time on this part of the lab!

Part 2: c implementation of a second-order section

You may want to implement the second-order section with the following function declaration:

long iirSoS(int *b, int *a, int *w_states, long input);

The above declaration is only a recommendation, and the exact number of arguments or even the datatypes used can be designed differently. The point though, is that this specification enables function re-use, unlike Lab 2 where different assembly functions were written for each filter.

In the suggested function declaration above, the first two arguments are pointers to the filter coefficients, the third argument is a pointer to the intermediate state buffer, and the final argument is the current input sample. The returned value is the output of the given second-order section.

Questions & Answers

what is defense mechanism
Chinaza Reply
what is defense mechanisms
Chinaza
I'm interested in biological psychology and cognitive psychology
Tanya Reply
what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ece 420 spring 2014. OpenStax CNX. Jan 18, 2014 Download for free at http://cnx.org/content/col11618/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 420 spring 2014' conversation and receive update notifications?

Ask