audio equalizer audio equalizer
play

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


  1. Graduate Institute of Electronics Engineering, NTU Audio Equalizer Audio Equalizer Instructor: Prof. Andy Wu ACCESS IC LAB

  2. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Basic Network Structure for FIR System Basic Network Structure for FIR System M ∑ = − y n h k x n k [ ] [ ] [ ] = k 0 Direct-form Transposition of direct-form P2

  3. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Cascade Form Cascade Form � Cascade 2nd-ordered direct-form FIR filter to get a polynomial system function. M Ms ∑ ∏ = − = + − + − n 1 2 H z ( ) h n z [ ] ( b b z b z ) 0 k 1 k 2 k = = n 0 k 1 P3

  4. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Coding for FIR at High- -Level Level Coding for FIR at High Programming Language Programming Language P4

  5. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 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; P5

  6. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 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/2 16 � Data obtained from ADC is integer, not fraction, remember to do proper normalization P6

  7. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Obtain FIR Filter Coefficients from MATLAB Obtain FIR Filter Coefficients from MATLAB � Filter Design Toolbox � Filter Design & Analysis Tool (FDATool) P7

  8. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 5. 1. 2. 3. 4. 6. P8

  9. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Step- -by by- -step (1) step (1) Step 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 � 邊緣變化情形 P9

  10. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Step- -by by- -step (2) step (2) Step 5. 選擇不同的 view � Magnitude response, Filter coefficient… 6. Design Filter � 得到實驗所需的 Filter coefficient P10

  11. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 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. P11

  12. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 1D Discrete Cosine Transform 1D Discrete Cosine Transform � N-point 1D DCT and Inverse DCT Time domain π + signal N k ( 2 x 1 ) ∑ = F ( k ) c ( k ) f ( x ) cos( ) DCT 2 N = x 0 π + N k ( 2 x 1 ) ∑ = IDCT f ( x ) c ( k ) F ( k ) cos( ) 2 N = k 0 Coefficient of = { 1 / N , i 0 = c i ( ) cosine wave 2 / N , otherwise … P12

  13. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Mix Stereo Audio Mix Stereo Audio Note the weighting should be normalized [4] P13

  14. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 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. P14

  15. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 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. P15

  16. ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Reference Reference [1] Alan V. Oppenheim, Ronald W. Schafer, John R. Buck, “Discrete-Time Signal Processing”, 2 nd 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 P16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend