Presentation is loading. Please wait.

Presentation is loading. Please wait.

Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Increase the Dynamic Range and Precision of Digital.

Similar presentations


Presentation on theme: "Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Increase the Dynamic Range and Precision of Digital."— Presentation transcript:

1 Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Increase the Dynamic Range and Precision of Digital Filters by using an MCU’s FPU CL03I Kevin P King - Senior Staff Application Engineer

2 © 2012 Renesas Electronics America Inc. All rights reserved.2 Kevin P King Education Electrical Engineering, University of Lowell (Edward B Van Dusen Award for Academic Achievement) Thirty years of Embedded Design Experience (x86, HC05, HC11, 8051, Philips XA, Atmel AVR, Hitachi, Mitsubishi, etc.... Five years of Emulator design for MetaLink COP8, 68HC05, 68HC11, 8051 (multi-vendors), National CR16, Hitachi H8/500, etc... Multiple Quality Awards for Embedded Software & Hardware Development. Specialty is Embedded System Design - MCU firmware & hardware Senior Staff Application Engineer RX DSP Library Development Team Numerous Motor Control and Medical App notes 2010 Patent Award for Motor Control

3 © 2012 Renesas Electronics America Inc. All rights reserved.3 Renesas Technology & Solution Portfolio

4 © 2012 Renesas Electronics America Inc. All rights reserved.4 Microcontroller and Microprocessor Line-up Wide Format LCDs  Industrial & Automotive, 130nm  350µA/MHz, 1µA standby 44 DMIPS, True Low Power Embedded Security, ASSP 165 DMIPS, FPU, DSC 1200 DMIPS, Performance 1200 DMIPS, Superscalar 500 DMIPS, Low Power 165 DMIPS, FPU, DSC 25 DMIPS, Low Power 10 DMIPS, Capacitive Touch  Industrial & Automotive, 150nm  190µA/MHz, 0.3µA standby  Industrial, 90nm  200µA/MHz, 1.6µA deep standby  Automotive & Industrial, 90nm  600µA/MHz, 1.5µA standby  Automotive & Industrial, 65nm  600µA/MHz, 1.5µA standby  Automotive, 40nm  500µA/MHz, 35µA deep standby  Industrial, 40nm  200µA/MHz, 0.3µA deep standby  Industrial, 90nm  1mA/MHz, 100µA standby  Industrial & Automotive, 130nm  144µA/MHz, 0.2µA standby 2010 2012 32-bit 8/16-bit

5 © 2012 Renesas Electronics America Inc. All rights reserved.5 ‘Enabling The Smart Society’ Challenge: “More and more sensors are required by our “smart” devices and reliable filtering is required to separate the signal from the noise.” Solution: “This lab will help you evaluate whether your Digital Filtering application requires the precision and performance of devices with Floating Point Units (FPU).” Wireless Module Doctor, your patient is in distress

6 © 2012 Renesas Electronics America Inc. All rights reserved.6 Lab Agenda System Block Diagram Analog filter Data Collection Filter Review View and Collect Data Fix “bad” FIR filter Implement Floating Point IIR Implement Fixed Point IIR Summary

7 © 2012 Renesas Electronics America Inc. All rights reserved.7 Hypothetical Filter Applications

8 © 2012 Renesas Electronics America Inc. All rights reserved.8 ADC Considerations - Benchmark Example RX63N allows triggering ADC from MTU2 (timer) DMAC transfers data to buffer © 2010 Renesas Electronics America Inc. All rights reserved. Using the HW assist to acquire and transfer data to buffer saves ~7% CPU BW Data gets “replaced” right here since We don’t have 15 Function Generators

9 © 2012 Renesas Electronics America Inc. All rights reserved.9 FIR Filters

10 © 2012 Renesas Electronics America Inc. All rights reserved.10 Filter Applications – The Boxcar Filter Very common to perform a “running” average Sum n samples, scale the output (usually divide by n) Recalculate each time one new sample comes in Very simple FIR called boxcar All coefficients equal to 1 Example of 8 kHz sampling rate, 8 tap FIR

11 © 2012 Renesas Electronics America Inc. All rights reserved.11 Filter Types - FIR Typically the gain = 1 Decimation can be on front or back end Lab: back-end decimation X[n] – Input samples nD – Decimation Factor Y”[n] – Decimated Output B[n] – Coefficients (multiplies) Z -1 – Delay elements (storage array)

12 © 2012 Renesas Electronics America Inc. All rights reserved.12 IIR Filters

13 © 2012 Renesas Electronics America Inc. All rights reserved.13 IIR Since round-off error in output feeds back IIR requires greater precision 16 bit precision typically sufficient for FIR IIR requires 32 bit precision 1 Floating point simplifies math Not as many IIR design tools b0,b1,b2,a0,a1

14 © 2012 Renesas Electronics America Inc. All rights reserved.14 Effects of Quantization Error

15 © 2012 Renesas Electronics America Inc. All rights reserved.15 Effects of Quantization Error

16 © 2012 Renesas Electronics America Inc. All rights reserved.16 Why use IIR Design 5 kHz bandpass Sampling rate 44 kHz Center Frequency - 5 kHz Passband - 1 kHz Stopband attenuation 40 dB Passband ripple = 2 dB FIR filter requires 132 taps: IIR filter only requires 17 taps (13 non-zero) Forward coefficients – 1,0,-4,0,6,0,-4,0,1 Feedback coefficients © 2010 Renesas Electronics America Inc. All rights reserved. -0.9027953874, 5.5279871696, -16.3895992764 29.9415524963, -36.6655508659, 30.7172057969 -17.2497536574. 5.9688037639

17 © 2012 Renesas Electronics America Inc. All rights reserved.17 Designing the Filter Programs like ScopeFIR or WinFilter allow simple design of the filter

18 © 2012 Renesas Electronics America Inc. All rights reserved.18 Frequency Response of 8 Tap 4 kHz Filter © 2010 Renesas Electronics America Inc. All rights reserved. -12dB line 20 dB attenuation at 8 kHz compared to 12 for analog filter

19 © 2012 Renesas Electronics America Inc. All rights reserved.19 Improved 4 kHz Filter © 2010 Renesas Electronics America Inc. All rights reserved. By using 14 taps notice the improved attenuation at 6 kHz

20 © 2012 Renesas Electronics America Inc. All rights reserved.20 Pop Quiz If I chose a sample rate of 20kHz and feed it into a FIR filter with decimation 4, what “sampling” frequency do I use when I am determining my coefficients? 20k 10k 5k None of the above Depends on where the decimation is. 5k if decimated on front end, 20k if decimated on back end

21 © 2012 Renesas Electronics America Inc. All rights reserved.21 Start the Lab Let us know if you get stuck on a step That is what the cheerful assistant is here for – to help Please refer to the lab handout and let’s get started!

22 © 2012 Renesas Electronics America Inc. All rights reserved.22 Checking Progress Evaluate Compile Design Filter

23 © 2012 Renesas Electronics America Inc. All rights reserved.23 Lab Questions, Section 1: 1.1 We are simulating full range ADC data. 1.2 ScopeDSP is restricted in the file data, so you need to log in a format tools can understand / read. 1.3 NO, many programs like Excel are flexible in the data they will accept.

24 © 2012 Renesas Electronics America Inc. All rights reserved.24 Lab Questions, Section 2: 2.1 We decimated at the output 2.2Filter 1 should have been a High pass filter showing more 1K than 50Hz 2.3 Approx 10db

25 © 2012 Renesas Electronics America Inc. All rights reserved.25 Lab Questions Section 2 2.4Filter 2 should have been a Low pass filter showing more 50Hz than 1kHz 2.2 About 10 db

26 © 2012 Renesas Electronics America Inc. All rights reserved.26 Lab Questions, Section 3: 3.1Any need to worry about “scaling”? No 3.2Do the new coefficients improve the filter? Yes 3.3How much improvement, if any did you realize by just changing coefficients? Should be about 20-30 db

27 © 2012 Renesas Electronics America Inc. All rights reserved.27 Improved FIR output

28 © 2012 Renesas Electronics America Inc. All rights reserved.28 Lab Questions, Section 4: 4.1 MAC (MUL + ADD) 31 for “good” 31 tap FIR, 10 for good IIR (And you can probably do this in one bi-quad, so could be as low as 5). 4.2 FIR requires “n-1”, so 30 for the 31 tap filter (see diagram), IIR requires 4 for a direct form 1 bi-quad, so 8 total for the 2 stages of bi-quad.

29 © 2012 Renesas Electronics America Inc. All rights reserved.29 Lab Questions, Section 5: 5.116 bit does not provide enough resolution, so it errors saying quantization error too high, choose higher resolution. 5.2Increase resolution to 32 bit Fixed Point or single precision floats. 5.3Should fundamentally look the same, although you should notice a little “raggedness” on the low end. 5.4Quantization error.

30 © 2012 Renesas Electronics America Inc. All rights reserved.30 32 bit Fixed Point IIR Quantization Error

31 © 2012 Renesas Electronics America Inc. All rights reserved.31 IIR Low Pass fixed Point

32 © 2012 Renesas Electronics America Inc. All rights reserved.32 Lab Questions, Section 6: 5.5Divide by 2 30. These should be about the same as the floating point IIR. 0x40000000 = 1.0f, 0x7FFFFFFF = 1.999999f, (you changed manually) 0x40000000 = 1.0f, 0x94D25AE4 = -1.16266952641308307647705078125, 0x2D1C6797 = 0.704858682118356227874755859375 5.6Divide by 2 30. 0x3201EBD9 = 0.781367265619337558746337890625 5.7Hex makes it hard to determine actual value. 5.8??????

33 © 2012 Renesas Electronics America Inc. All rights reserved.33 Questions? Questions?

34 © 2012 Renesas Electronics America Inc. All rights reserved.34 Challenge: “More and more sensors are required by our “smart” devices and reliable filtering is required to separate the signal from the noise.” “This lab will help you evaluate whether your Digital Filtering application requires the precision and performance of devices with Floating Point Units (FPU).” Do you agree that we accomplished the above statement? ‘Enabling The Smart Society’ in Review…

35 © 2012 Renesas Electronics America Inc. All rights reserved.35 Please utilize the ‘Guidebook’ application to leave feedback or Ask me for the paper feedback form for you to use… Please Provide Your Feedback…

36 © 2012 Renesas Electronics America Inc. All rights reserved.36 Thank You!

37 © 2012 Renesas Electronics America Inc. All rights reserved.37 Appendix: Additional Information

38 © 2012 Renesas Electronics America Inc. All rights reserved.38 Resources ScopeFIR, ScopeIIR and ScopeDSP http://www.iowegian.com/ http://www.dspguru.com/ The Scientist and Engineer's Guide to Digital Signal Processing, copyright ©1997-1998 by Steven W. Smith. For more information visit the book's website at: www.DSPguide.com C. E. Shannon, "Communication in the presence of noise", Proc. Institute of Radio Engineers, vol. 37, no. 1, pp. 10–21, Jan. 1949. Reprint as classic paper in: Proc. IEEE, vol. 86, no. 2, (Feb. 1998) C. E. ShannonReprint as classic paper in: Proc. IEEE, vol. 86, no. 2, (Feb. 1998) http://www.winfilter.20m.com

39 Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved.


Download ppt "Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Increase the Dynamic Range and Precision of Digital."

Similar presentations


Ads by Google