In this experiment a function was created to compute DFT and IDFT of an N point sequence , where the value of N and the sequence was taken as input from the user and was sent as an arguement that function.
The DFT of four point sequence was calculated and magnitude spectrum was obtained for it. Then the 4 point sequence was zero padded to make it an 8 point sequence and its magnitude spectrum was obtained. After comparing the magnitude spectrums we could conclude that the one with appended zeros had better resolution.
NOTE: Please do not forget to include math library while compiling the code as we have used sine and cosine functions.
eg. gcc sample.c -lm
where "-lm" is the command used to include math library.
Without this the code wouldn't compile even if the entire code is right.
NOTE: Please do not forget to include math library while compiling the code as we have used sine and cosine functions.
eg. gcc sample.c -lm
where "-lm" is the command used to include math library.
Without this the code wouldn't compile even if the entire code is right.
As the length of signal increases (appending zeroes at the end) then the resolution gets better.
ReplyDeleteIts already mentioned in the blog ... still thanks for the comment
DeleteThe twiddle factors all lie on a unit circle; so the more the samples, the more that circle becomes complete, and hence the resolution gets better. The resolution increases because of more twiddle factors taken.
ReplyDeleteWell it seems very much similar to sampling and reconstruction.. more samples you take better is the reconstructed signal.... I hope i am getting this right
DeleteA complete circle will give you DTFT. Forgot to add that :)
ReplyDelete