Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

2 questions about DSP (beginner)

Status
Not open for further replies.

JCO

Newbie level 2
Joined
May 23, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
Hello,

I’m starting to learn DSP (Matlab )and I have two questions about it, maybe someone can help me out?
I’m trying to measure a frequency from an Audio Device and I’m using FFT to transform it from the time domain to the frequency domain. But I am doing a downsample before the FFT. But you can also do it after the FFT. Do you know what would be the most efficient (before or after)? And why?
Another question, I am using zero padding to increase my system resolution (up to 50Hz). My frame length is N=256 and sample frequency fs= 44100 Hz. So 44100/50 = 882, so I need to add 626 zeroes (to 256 frame length) to get 50 Hz resolution, I hope this is correct? I believe this is done for FFT. But is this the same for the DFT?

Thank you and regards,
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,487
Helped
4,308
Reputation
8,621
Reaction score
4,262
Trophy points
1,393
Activity points
129,206
Hi,

How do you do the downsampling? Why is it necessary?
Do you use an extra sample rate converter, then look into it´s datasheet about noise, harmonic distortion and other introduced errors.

To calculate the FFT frequency resolution you need the downsampled "sample rate".

about zero padding read:
https://www.bitweenie.com/listings/fft-zero-padding/

If you use an radix-2 FFT algorithm you need to use 2^n samples. (n= integer). So 882 samples are not possible. Maybe you need to expand to 1024 samples. Check on this.

For a DFT you usually don´t need the 2^n samples. But to be sure read on your DFT documentation.


Klaus
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,301
Helped
14,233
Reputation
28,727
Reaction score
12,925
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,678
about zero padding read
Yeah, beyond other points the article clarifies that zero-padding can't increase the frequency resolution.
 

JCO

Newbie level 2
Joined
May 23, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
Hi,

How do you do the downsampling? Why is it necessary?
Do you use an extra sample rate converter, then look into it´s datasheet about noise, harmonic distortion and other introduced errors.

To calculate the FFT frequency resolution you need the downsampled "sample rate".

about zero padding read:
https://www.bitweenie.com/listings/fft-zero-padding/

If you use an radix-2 FFT algorithm you need to use 2^n samples. (n= integer). So 882 samples are not possible. Maybe you need to expand to 1024 samples. Check on this.

For a DFT you usually don´t need the 2^n samples. But to be sure read on your DFT documentation.


Klaus

Hi,

Thanks for your advise. I was thinking to decrease the sampling rate with a Downsample block in Simulink and see what would the effect of putting it before and after the FFT (in terms of efficiency).
Also thanks for the link about zero padding. Indeed, the radix-2 FFT algorithm requires 2^n samples.

Regards
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,487
Helped
4,308
Reputation
8,621
Reaction score
4,262
Trophy points
1,393
Activity points
129,206
Hi,

44100 Hz / 50 Hz = 882
So if you use a 1024 FFT you should have a frequency resolution less than 50Hz.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top