views:

63

answers:

2

There are a lot of audio-resampling libraries available. My favorite in Secret Rabbit Code.

Audio resamplers keep the correct frequency of the resampled signals, so a 4KHz sine in the source, will remain a 4KHz sine in the destination.

This time, however, I need to resample a sampled IF/RF signal.

The sampled signal contains data originally in the frequency range f0-BW/2 to f0+BW/2, shifted to 0..BW.

Same as for audio signal, the correct frequency should be kept, but now "correct" means same distance from center - not distance from 0 as for sampled-audio.

For example [Edited]: If I resample a 64KSamples/Sec IF signal to 48KSamples/Sec, a tone in 16KHz will be in 12KHz after resampling, and a tone in 14KHz will be in 12KHz after resampling. The original range [4..28KHz] will now be [0..24KHz].

My question is: Can i reuse an audio-resampling code to do IF-resampling?

Note: My samples are real, not complex.

A: 

If you resample a signal, you will either lose or alias any content at or above fs/2. Any signals below fs/2 will remain at the same frequency.

So if you resample a signal at a sample rate of 64 ksps, than any content near or above 32 ksps should be filtered out first, or as part of the resampling filter/interpolator. You will probably lose any signal content not only at 32 khz but perhaps 30 kHz as well due to finite roll-off transition width of the anti-alias filter.

If you want to move a 32 kHz carrier to 24 kHz, you will have to filter out any modulation at or wider than +-12 kHz in bandwidth (so you have a signal spectrum from 8 to 56 kHz), then remodulate (which may need to be done in 2 steps), then resample.

hotpaw2
And suppose I want to shift real-samples vector from [4KHz..200KHz) to [0..196KHz), filtering out [0KHz..4KHz) ?
Lior Kogan
A: 

You say

The sampled signal contains data originally in the frequency range f0-BW/2 to f0+BW/2, shifted to 0..BW.

I suspect that you actually have a complex time domain stream of samples shifted from [f0-BW/2, f0+Bw/2) to [-BW/2, BW/2), where the real and imaginary samples are interleaved. You can prove this to yourself easily: if the input signal is a tone at f0, a quadrature receiver will generate two levels - one for the in-phase component and one for the quadrature. If the I and Q components are interleaved in the time domain stream, that will look like a signal at exactly half the sampling rate.

You can still resample such a data stream, you just have to make sure the resampling tool understands that you have two interleaved channels, or you have to deinterleave them first.

mtrw
Thank you, but I'm not wrong. My signal is shifted to [0, BW) (integer real samples). If I draw an spectrogram, the tone originally at f0 will be at BW/2.
Lior Kogan
Perhaps I misunderstood - is `f0` the mixing frequency?
mtrw
I am not mixing. I'm getting this real vector from a digital receiver. In the vector reported by the receiver, an original tone at f0 will be at BW/2.
Lior Kogan
I should have asked is `f0` the center frequency? If the input signal is a pure tone at `f0`, are the time domain samples all about equal - like a DC level? How are you drawing the spectrogram?
mtrw
f0 is the center frequency that the receiver was tuned to (or the IF frequency of the receiver - doesn't really matter). I am drawing the spectrogram using goldwave (or any other audio player for that matter). of course I can't hear anything meaningful since I'm listening to shifted IF.
Lior Kogan
OK, I have a new guess as to what's going on. Please see the edited answer. But if that's still not right, can you point me to the digital receiver documentation, if any exists?
mtrw
Take a look at http://www.winradio.com/home/g315i.htm. I get the exact same spectral picture in GoldWave when playing the recorded stream. The only difference is that the frequency axis in GoldWave is 0 to 20KHz (instead of -10 to +10 is WinRADIO's display) and my peak is in 10KHz - both for Real-time spectrum and spectrogram. (In the case described above I'm using a 32KHz WinRADIO, but it is the same idea).
Lior Kogan