Audio Equalizer Audio Equalizer Instructor: Prof. Andy Wu ACCESS - - PowerPoint PPT Presentation

audio equalizer audio equalizer
SMART_READER_LITE
LIVE PREVIEW

Audio Equalizer Audio Equalizer Instructor: Prof. Andy Wu ACCESS - - PowerPoint PPT Presentation

Graduate Institute of Electronics Engineering, NTU Audio Equalizer Audio Equalizer Instructor: Prof. Andy Wu ACCESS IC LAB ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Basic Network Structure for FIR System Basic Network


slide-1
SLIDE 1

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

Audio Equalizer Audio Equalizer

Instructor: Prof. Andy Wu

slide-2
SLIDE 2

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P2

Basic Network Structure for FIR System Basic Network Structure for FIR System

[ ] [ ] [ ]

M k

y n h k x n k

=

= −

Direct-form Transposition

  • f direct-form
slide-3
SLIDE 3

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P3

Cascade Form Cascade Form

Cascade 2nd-ordered direct-form FIR filter to get a polynomial system function.

1 2 1 2 1

( ) [ ] ( )

Ms M n k k k n k

H z h n z b b z b z

− − − = =

= = + +

∑ ∏

slide-4
SLIDE 4

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P4

Coding for FIR at High Coding for FIR at High-

  • Level

Level Programming Language Programming Language

slide-5
SLIDE 5

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P5

Use FIR Function in DSP Library Use FIR Function in DSP Library

#include <filter.h> const fract16 x[]; /* Input sample vector x */ fract16 y[]; /* Output sample vector y */ int inum; /* Number of input samples */ fir_state_fr16 *state; /* Pointer to filter state structure */ int main() { … fir_init(state,coeffs_array,delayline,num_coeffs interpolation_idx); fir_fr16(x,y,inum,state) ; }

The function uses the following structure to maintain the state of filter.

typedef struct { fract16 *h, /* filter coefficients */ fract16 *d, /* start of delay line */ fract16 *p, /* read/write pointer */ int k; /* number of coefficients */ int l; /* interpolation/decimation index */ } fir_state_fr16;

slide-6
SLIDE 6

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P6

Note Note

Blackfin BF533 is a fixed-point DSP, there is no floating-point data type. frac16 is used to for fraction number

  • representation. -1~1, resolution is 2/216

Data obtained from ADC is integer, not fraction, remember to do proper normalization

slide-7
SLIDE 7

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P7

Obtain FIR Filter Coefficients from MATLAB Obtain FIR Filter Coefficients from MATLAB Filter Design Toolbox Filter Design & Analysis Tool (FDATool)

slide-8
SLIDE 8

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P8 1. 2. 3. 4. 5. 6.

slide-9
SLIDE 9

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P9

Step Step-

  • by

by-

  • step (1)

step (1)

  • 1. Type

FIR or IIR, Low-pass or Band-pass…

  • 2. Order

7, 8 or more…

  • 3. Frequency Specification

Fs, Fpass, Fstop… 頻率響應的參數

  • 4. Magnitude Specification

邊緣變化情形

slide-10
SLIDE 10

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P10

Step Step-

  • by

by-

  • step (2)

step (2)

  • 5. 選擇不同的view

Magnitude response, Filter coefficient…

  • 6. Design Filter

得到實驗所需的Filter coefficient

slide-11
SLIDE 11

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P11

Implement Filter at Frequency Domain Implement Filter at Frequency Domain

Spectrum analysis Transform input audio signal from time-domain magnitude to frequency domain coefficients. Determine filter frequency response directly.

slide-12
SLIDE 12

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P12

1D Discrete Cosine Transform 1D Discrete Cosine Transform

N-point 1D DCT and Inverse DCT

=

+ =

N x

N x k x f k c k F ) 2 ) 1 2 ( cos( ) ( ) ( ) ( π

{

  • therwise

N i N i c , / 2 , / 1 ) ( = =

=

+ =

N k

N x k k F k c x f ) 2 ) 1 2 ( cos( ) ( ) ( ) ( π

Coefficient of cosine wave Time domain signal

DCT IDCT

slide-13
SLIDE 13

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P13

Mix Stereo Audio Mix Stereo Audio

Note the weighting should be normalized [4]

slide-14
SLIDE 14

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P14

Exercise Lab Exercise Lab

Run FIR example @ ..\Analog Devices\VisualDSP 3.5 16-Bit\Blackfin\Examples\FIR\ Add equalizer function to your audio talk-through system Design at least 3 FIR filter coefficients sets (such as bass enhance, treble enhance, bandpass, notch…), implement them in your system. You should use the button on EVB to switch between those preset equalizer modes. Bonus:

Design a transform-based equalizer and allow user to adjust its frequency response at runtime. Add left/right channel mixing function to your system and allow user to choose enable or not at runtime.

slide-15
SLIDE 15

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P15

Submission Submission

Due: 2004/11/11 Thursday Mailto: tommy@access.ee.ntu.edu.tw Requirement:

Architecture of your system Plot input and output signal (time and frequency domain) and compare Discussion Suggest to this slide: content, teaching skill… anything you feel inadequate.

slide-16
SLIDE 16

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

P16

Reference Reference

[1] Alan V. Oppenheim, Ronald W. Schafer, John R. Buck, “Discrete-Time Signal Processing”, 2nd edition, Prentice Hall, ISBN 0-13-083443-2 [2] MATLAB Help [3] “Visual DSP++ 3.5 Compiler and Library Manual for Blackfin Processors”, Revision 2.2, October 2003 [4] http://www.enel.ucalgary.ca/People/Smith/ECE-ADI- Project/AudioProject/AudioLectureMaterial/Lecture_AudioCourseInfoFr ame.htm