Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEEB0765 Digital Signal Processing for Embedded Systems 3 DSP Transforms: FFT and DCT Assoc. Prof. Dr. Peerapol Yuvapoositanon Dept. of Electronic Engineering.

Similar presentations


Presentation on theme: "EEEB0765 Digital Signal Processing for Embedded Systems 3 DSP Transforms: FFT and DCT Assoc. Prof. Dr. Peerapol Yuvapoositanon Dept. of Electronic Engineering."— Presentation transcript:

1 EEEB0765 Digital Signal Processing for Embedded Systems 3 DSP Transforms: FFT and DCT Assoc. Prof. Dr. Peerapol Yuvapoositanon Dept. of Electronic Engineering CESdSP DSPEB- 1 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon

2 Outline Simulink for Real-time Estimation FFT and Short-Time FFT (STFFT) Discrete Cosine Transform (DCT) CESdSP EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-2

3 FFT From Sometimes, we prefer EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-3

4 Embedded FFT FFT is embedded in many instruments: Scope, Spectrum Analyzer. In Simulink, we can use Spectrum Scope in Signal Processing Blockset. EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-4

5 Embedded FFT EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-5 ex_fft_tut.slx

6 Filters Analysis with FDATOOL and FFT Testing a filter sweeping frequency with FDATOOL. FFT block can interact with FDATOOL. EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-6

7 Filters Analysis with FDATOOL and FFT EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-7 doc_vectorscope_tut_mod.mdl

8 Short-time FFT (STFFT) The data to be transformed could be broken up into chunks or frames. EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-8

9 Short-time FFT (STFFT) W(n) is a window function EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-9

10 Uncertainty Principle Comparison of STFT resolution. The left fig. has better time resolution, and the right one has better frequency resolution. EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-10 http://en.wikipedia.org/wiki/Short-time_Fourier_transform

11 Comparison: Periodogram v.s STFFT EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-11 dspstfft.mdl

12 Comparison: Periodogram v.s STFFT EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-12

13 Discrete Cosine Transform EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-13

14 x = (1:100) + 50*cos((1:100)*2*pi/40); EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-14

15 Three Largest DCT Coeff X = dct(x); plot(X) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-15

16 99 % of energy is in a few (3) coefficients [XX,ind] = sort(abs(X)); ind = fliplr(ind); i = 1; while (norm([X(ind(1:i)) zeros(1,100- i)])/norm(X)<.99) i = i + 1; end EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-16 i=3

17 Idct(X) No. of Coefficients = 100 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-17 testdct.m

18 No. of Coefficients = 3 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-18

19 No. of Coefficients = 5 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-19

20 No. of Coefficients = 6 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-20

21 No. of Coefficients = 7 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-21

22 No. of Coefficients = 8 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-22

23 No. of Coefficients = 9 EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-23

24 2D-DCT CESdSP EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-24

25 2D DCT Demo A = im2double(imread('rice.png')); D = dctmtx(size(A,1)); dct = D*A*D'; figure; imshow(dct) CESdSP EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-25

26 Image to be transformed Rice.png CESdSP EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-26

27 A = im2double(imread('rice.png')); D = dctmtx(size(A,1)); dct = D*A*D'; figure; imshow(dct) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-27

28 DCT Coefficients CESdSP EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-28 Large values Small values

29 Reconstruction A=D'*dct*D; imshow(A) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-29

30 Now Construct the reduced >> rddct =zeros(size(A)); EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-30

31 = 30 x 30 >> rddct(1:30,1:30)=dct(1:30,1:30) ; >> Ard = D'*rddct*D; >> imshow(Ard) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-31

32 = 50 x 50 >> rddct(1:50,1:50)=dct(1:50,1:50) ; >> Ard = D'*rddct*D; >> imshow(Ard) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-32

33 = 90 x 90 >> rddct(1:90,1:90)=dct(1:90,1:90) ; >> Ard = D'*rddct*D; >> imshow(Ard) EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-33

34 JPEG Compression Standard EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-34

35 Demo on JPEG Coding EEEB0765 DSP fort Embedded Systems http://embedsigproc.wordpress.com/eeeb0765 Assoc. Prof. Dr. P.Yuvapoositanon DSPEB-35 block2D_dct_demo.mdl >> I = imread('cameraman.tif');


Download ppt "EEEB0765 Digital Signal Processing for Embedded Systems 3 DSP Transforms: FFT and DCT Assoc. Prof. Dr. Peerapol Yuvapoositanon Dept. of Electronic Engineering."

Similar presentations


Ads by Google