Dcmplx wn twittle factors

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: " ! !" ! ∗! ! ! ! ! (! ! ) !" ! ! ∗ ! !(!! ! ) . Also at . If x(t) is of cos function, then the value ∗ ! !" . Also at frequency (N ­m)/N (Hz), the DFT value is ∗ ! !!" . Here N = 16, fs = 1600Hz, then we can get the corresponding non ­zero DFT outputs are shown as below: i): X[4] = 32∠ − 90°, X[12]= 32∠90° ii): X[3]=16∠ − 90°, X[13]=16∠90°, X[4]=8∠0°, X[12]=8∠0° iii): X[1]=4∠90°, X[15]=4∠ − 90° iv): X[1]=4∠90°, X[15]=4∠ − 90°, X[0]=48∠0 Q7. Answer: i): Code is as below: #include<complex> #include<iostream> #include<cmath> using namespace std; typedef complex<double> dcmplx; #define N 8 const dcmplx I = dcmplx(0,1); //i (or j if you prefer) const double PI = 4.0*atan(1.0); //3.14 etc. dcmplx W[N]; //twittle factors // initilize the twittle factors void initW(dcmplx W) { for(int n=0;n<...
View Full Document

This note was uploaded on 01/13/2014 for the course EECS 452 taught by Professor Staff during the Fall '08 term at University of Michigan.

Ask a homework question - tutors are online