Showing results for 
Search instead for 
Did you mean: 

Normalization of FFT Spectrum

Go to solution

Dear Sir


As per your instructions, I have done normalization. Can you please verify that is it correct or not. Attach is the vi.



Kind Regards



0 Kudos
Message 11 of 20

The power spectrum is not normalized to the 100 Hz component but to the DC component which happens to be slightly larger. The maximum value of the magnitude of the power spectrum is -14.95 at index 0. If you remove the first two elements, then the maximum value is -17.07 at index 498 (500 in the original array). So simply using the maximum value without verifying that it corresponds to the correct frequency results in a 2 dB error in the normalization.


The peak amplitude of the spectrum does not accurately represent the amplitude of the fundamental component of the signal due to spectral leakage. Note that the bins at 49.8 and 50.2 Hz are 1/3 to 1/5 the amplitude of the 50 Hz bin. If you ignore that energy you do not get proper normalization. The Extract Single Tone and the Tone Measurements Express VI use FFT techniques internally and do account for the leakage. So using the amplitude output from one of those and applying it to the linear (non-dB) output of the spectrum VI can get better results. 


Spectral leakage.png


The attached VI uses FFT spectrum (MagPhase) for the current rather than a power spectrum. I found a square root of 2 factor is required to account for rms versus amplitude of a sine wave. Note that the graphs are set to log scaling and not adjusted for dB. The current spectrum is normalized the way I described here. The power spectrum uses the method of your VI with the DC component removed. Why is there a DC component? 



0 Kudos
Message 12 of 20

Dear Sir


I am thankful to you for your consistant support. I follow your guidelines and make normalization. Can you please verify it whether its correct or still wrong. Please note that I have to represent my data on y-axis in dB scale.


Kind Regards



0 Kudos
Message 13 of 20
Accepted by tronoh

1. If it will ever be possible that the detected frequency found by Extract Single Tone is not the fundamental, you may need to do some testing to be sure that you normalize to the fundamental. For example suppose the current was all in a very narrow pulse which occurs once per cycle. This is common in diode rectifier circuits feeding a capacitor input filter. The detected frequency might be a harmonic. It is possible to create signals where one or more harmonic components are larger than the fundamental.  Extract Single Tone will find the frequency of the component with the largest amplitude unless you limit the search range.


2. The normaiization technique I described cannot be used (with correct results) on data which is already scaled to dB. To display dB on the graphs you can use the linear (dB off) mode in the Spectrum VIs and then take the logarithm of the magnitude and scale it to dB. Note that on the current spectrum in my VI that the Instantaneous Current Spectrum shows that peak at 50 Hz having a value ~0.1 while the normalized spectrum has a peak value of 1.  In your VI the peak current is -20.5 dB (135 mA) while the normalized spectrum peak is at -214 dB! The peak in a normalized spectrum should be at 0 dB.


The power spectrum in my VI uses an approximate normaiization based on the peak dB value. The peak in the Instantaneous Power Spectrum is ~-15 dB and in the normalized power spectrum it is at zero dB.


3. The normalization can be done in the dB domain. The amplitude of the tone found by Extract Single Tone must be converted to dB and then subtracted. In the attached VI I have shown this method. It also contains the method used in the linear domain for current so that you can compare. For both of the Extract Single Tone Information.vis I added a constant wired to the advanced seach input to limit the search to values near the fundamental frequencies. This eliminates the issues discussed in item 1 above. Also note that I used FFT (Mag-Phase).vi for the current and FFT Power for the power. I think it preserves the units and scaling better.



Message 14 of 20

Dear Mr Lynn


I am thankful to you for your continuous support. I have done it using waveform normalization function. Can you please verify that is it correct or not.


Kind Regards



0 Kudos
Message 15 of 20

What you have is normalization of the total time domain signal. This does not normalize to the the fundamental although it may be close when the distortion is small.  Note that the detected amplitudes of both the normalized current and power waveforms are not what you would expect from a sine wave with a peak of 1.



Message 16 of 20

Hi urfee,


why do you create two threads with nearly the same topic using different user accounts? Why should we answer your questions twice?


Please stick to one thread and only use one user account…

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 20

Dear Mr Gerdw


We are working in group so that thread was from my group fellow. However, next time we will try to post similar questions in one post.



Kind Regards



0 Kudos
Message 18 of 20




0 Kudos
Message 19 of 20




0 Kudos
Message 20 of 20