Friday 18 December 2015

fft - Controlling a signals amplitude in the frequency domain




I want to control the amplitude of a signal I'm creating from a user drawn spectrum by scaling the magnitude values in the frequency domain. Here is my scenario.



  • Sample rate $F_s= 44100\textrm{ Hz}$

  • FFT size $NFFT = 512$

  • Desired waveform frequency: $86.1328125\textrm{ Hz}$ ($44100/512$ so a single cycle)


My user input screen has the magnitudes presented like a bar chart and they are all stored as values with a range of $0.0$ to $1.0$.


How do I scale these in the frequency domain so that the output signal is a $0\textrm{ dB}$ signal?



Answer




You can use Parseval's theorem for DFT. $$ \sum_{n=0}^{N-1} |x[n]|^2 = \frac{1}{N} \sum_{к=0}^{N-1} |X[n]|^2 $$ Where $$x[n]$$ - n-th signal sample, $$X[n]$$ - n-th value of the DFT of the signal


No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...