Re: Computed Power Range Does Not Match Spectrum Analyzer
- From: "allendm2001" <allendm2001@xxxxxxxxx>
- Date: Fri, 06 Jan 2006 07:50:15 -0600
>Bhaskar Thiagarajan wrote:
>> "allendm2001" <allendm2001@xxxxxxxxx> wrote in message
>> news:6uKdnfHS15In5iDenZ2dnUVZ_v6dnZ2d@xxxxxxxxxxxxxxx
>> > I'm new to DSP and am attempting to use an FFT to approximate in
software
>> > the output of a hardware spectrum analyzer. Using MATLAB, I
calculate the
>> > power as follows:
>> >
>> > fftOut = fft(samples,512);
>> > magnitude = fftOut. * conj(fftOut);
>> > scaled = magnitude. / 512;
>> > power = 10 * log10(scaled);
>> >
>> > The resultant power spectrum looks like the signal displayed on the
>> > spectrum analyzer, however the range is much different. Power values
from
>> > the Matlab power spectrum range between +90 and +150dB, whereas
power
>> > values on the spectrum analyzer range from -40 to -100dB. Am I
doing
>> > something wrong in my calculation, or do I have to adjust my output
by
>> > some constant. If I do have to adjust, why?
>>
>> Power values on the spectrum analyzer are probably in dBm (not dB).
This
>> means they are absolute amplitude measurements (not relative...which
would
>> be dB). dBm is a power value reference to 1 milliwatt of power. A
spectrum
>> analyzer is a calibrated receiver and can apply the appropriate offsets
and
>> scaling based on it's internal gain and attenuation settings.
>>
>> When you make power spectrum measurements in Matlab, you are going to
need
>> some information about your sampled data to apply similar corrections.
>> Without this, the best you can do is to normalize your fft output to
the
>> largest signal. That'll give a 0dB (not dBm) output for your largest
signal
>> and you can look at other signals relative to this.
>>
>> So I'd do something like
>> scaled = magnitude/max(magnitude). (BTW, what you have isn't magnitude
but
>> power here).
>>
>> At this point you should only be off by a single offset value between
the
>> spectrum analyzer and your matlab output.
>>
>> Cheers
>> Bhaskar
>>
>> > Thank you,
>> >
>> > Doug Allen
>> > Praxis Engineering Technologies, Inc.
>> > dmallen@xxxxxxxxxxxxx
>> >
>
>This is something I've dealt with many times, and it can be tricky. It
>also depends on whether your input signal is noise or tones. Here is
>one approach for tones. Start by feeding a maximum value, Fs/4 sequence
>into the FFT. For example if you have a 16 bit ADC, feed in
>32767,0,-32768,0,etc. After you convert your FFT bin magnitudes into
>decibels (10log10(I^2+Q^2)), add a scale factor to adjust the center
>bin up to zero dB. This factor will vary with the window. After the
>factor is applied, your FFT is producing data in units of dBFS, or dB
>relative to ADC full scale.
>
>The next step is to figure out how much input signal produces peak
>value samples from your ADC. You can do this by looking at some of your
>ADC values as feed a sine wave into it from a signal generator. Try a
>sinewave with a low digital frequency and adjust the level until the
>peaks get close to the maximum and minimum values, 32767 and -32768.
>Then record the power of the signal generator, typically in dBm. A
>typical value might be -10 dBm, but it depends on what is in front of
>the ADC, the ADC itself, as well as the output impededance of your
>generator. You can work this out from the schematic and data sheet but
>you will want to test it anyway.
>
>If you know that -10 dBm produces full scale ADC values, then you can
>just add 10 dB to the scaled FFT output to convert those values into to
>dBm at the generator output. If you have RF and IF gain in front of the
>ADC, then you can subtract that gain directly to get dBm at the antenna
>input.
>
>John
>
>
Thank you all for taking the time and being so incredibly responsive to my
questions.
Doug
.
- References:
- Computed Power Range Does Not Match Spectrum Analyzer
- From: allendm2001
- Re: Computed Power Range Does Not Match Spectrum Analyzer
- From: Bhaskar Thiagarajan
- Re: Computed Power Range Does Not Match Spectrum Analyzer
- From: john
- Computed Power Range Does Not Match Spectrum Analyzer
- Prev by Date: OT: Snow. Was: Happy New Year, everybody!
- Next by Date: Re: ccs+graph
- Previous by thread: Re: Computed Power Range Does Not Match Spectrum Analyzer
- Next by thread: QAM demapping to LDPC decoder
- Index(es):
Relevant Pages
|