Signal Package pwelch

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Signal Package pwelch

Thomas D. Dean-2
I have a application using the signal package pwelch function that seems
to produce an incorrect plot.

[s, f] = pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate,
detrend='none', range='shift', plot_type = 'dB')

iq is read from an rtl-sdr

knowing the location of some signals, like the Hydrogen line, and,
comparing this to python, pwelch puts the "hydrogen bump" about .3MHz
too high.

pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate, detrend='none',
range='shift', plot_type = 'dB');

How do I upload an image to show this?

Tom Dean


Reply | Threaded
Open this post in threaded view
|

Re: Signal Package pwelch

Thomas D. Dean-2
On 8/13/19 1:32 PM, Thomas D. Dean wrote:

> I have a application using the signal package pwelch function that seems
> to produce an incorrect plot.
>
> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate,
> detrend='none', range='shift', plot_type = 'dB')
>
> iq is read from an rtl-sdr
>
> knowing the location of some signals, like the Hydrogen line, and,
> comparing this to python, pwelch puts the "hydrogen bump" about .3MHz
> too high.
>
> pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate, detrend='none',
> range='shift', plot_type = 'dB');
>
> How do I upload an image to show this?

More information,

The "hydrogen bump" should be between 1420400000 and 1420500000 Hz.
But, pwelch places it between 1420700000 and 1420850000

octave:100> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, ...
         Fs=sample_rate,  detrend='none', range='shift', ...
         plot_type = 'dB');
octave:101> freq
freq =  1420400000
octave:102> x = freq + f;
octave:103> idx=find( ( x >= 1420700000 ) & ( x <= 1420850000 ) );
octave:104> plot( x(idx), 10*log10(s(idx)));

I can post the .cc and the .m code, if anyone is interested.

Tom Dean


Reply | Threaded
Open this post in threaded view
|

Re: Signal Package pwelch

Thomas D. Dean-2
On 8/13/19 2:12 PM, Thomas D. Dean wrote:

> On 8/13/19 1:32 PM, Thomas D. Dean wrote:
>> I have a application using the signal package pwelch function that
>> seems to produce an incorrect plot.
>>
>> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate,
>> detrend='none', range='shift', plot_type = 'dB')
>>
>> iq is read from an rtl-sdr
>>
>> knowing the location of some signals, like the Hydrogen line, and,
>> comparing this to python, pwelch puts the "hydrogen bump" about .3MHz
>> too high.
>>
>> pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate, detrend='none',
>> range='shift', plot_type = 'dB');
>>
>> How do I upload an image to show this?
>
> More information,
>
> The "hydrogen bump" should be between 1420400000 and 1420500000 Hz.
> But, pwelch places it between 1420700000 and 1420850000
>
> octave:100> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, ...
>          Fs=sample_rate,  detrend='none', range='shift', ...
>          plot_type = 'dB');
> octave:101> freq
> freq =  1420400000
> octave:102> x = freq + f;
> octave:103> idx=find( ( x >= 1420700000 ) & ( x <= 1420850000 ) );
> octave:104> plot( x(idx), 10*log10(s(idx)));
>
> I can post the .cc and the .m code, if anyone is interested.
>
I will try to attach the image.



python-vs-octave.png (603K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Signal Package pwelch

Thomas D. Dean-2
In reply to this post by Thomas D. Dean-2
On 8/13/19 2:12 PM, Thomas D. Dean wrote:

> On 8/13/19 1:32 PM, Thomas D. Dean wrote:
>> I have a application using the signal package pwelch function that
>> seems to produce an incorrect plot.
>>
>> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate,
>> detrend='none', range='shift', plot_type = 'dB')
>>
>> iq is read from an rtl-sdr
>>
>> knowing the location of some signals, like the Hydrogen line, and,
>> comparing this to python, pwelch puts the "hydrogen bump" about .3MHz
>> too high.
>>
>> pwelch(iq,[], overlap=0, NFFT=2048, Fs=sample_rate, detrend='none',
>> range='shift', plot_type = 'dB');
>>
>> How do I upload an image to show this?
>
> More information,
>
> The "hydrogen bump" should be between 1420400000 and 1420500000 Hz.
> But, pwelch places it between 1420700000 and 1420850000
>
> octave:100> [s, f] = pwelch(iq,[], overlap=0, NFFT=2048, ...
>          Fs=sample_rate,  detrend='none', range='shift', ...
>          plot_type = 'dB');
> octave:101> freq
> freq =  1420400000
> octave:102> x = freq + f;
> octave:103> idx=find( ( x >= 1420700000 ) & ( x <= 1420850000 ) );
> octave:104> plot( x(idx), 10*log10(s(idx)));
>
> I can post the .cc and the .m code, if anyone is interested.
>
> Tom Dean
>
>

Fixed.  Strange character in the .m file.

Sorry for the noise.

Tom Dean