Lior Kogan
Lior Kogan

Reputation: 20608

How can I use an audio-resampler to resample IF signals

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.

Upvotes: 1

Views: 927

Answers (2)

mtrw
mtrw

Reputation: 35088

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.

Upvotes: 0

hotpaw2
hotpaw2

Reputation: 70673

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.

Upvotes: 1

Related Questions