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