DSPRelated.com
Forums

re-sampling - sample rate conversion

Started by manishp October 13, 2011
can anyone clarify which of the following is the right method for
re-sampling (sample rate conversion)

method 1
- up-sample by adding additional samples (usually 0) to the input samples
- convolve using a LPF

method 2
- up-sample by adding additional samples to the input samples
- pick up only selected samples (e.g. 1 in 10; 1 in 20 etc.)

I am unable to appreciate about method 1 since sampling a signal at a
specific rate and filtering the low frequency components are two different
things. 

Method 2 looks more logical but in this method we are most likely to pick
up '0' valued samples more often than not.

Can someone help me understand. The above example is for up-conversion.
Here are 3 links that should get you on the right track:

http://www.dspguru.com/dsp/faqs/multirate/resampling

http://www.dspguru.com/dsp/faqs/multirate/decimation

http://www.dspguru.com/dsp/faqs/multirate/interpolation


Go with method 1.

Say you have a signal sampled at Fs Hz and you want to resample to
M*Fs Hz

Then you insert (M-1) zeros after each sample and low-pass filter the
resulting signal. The cut-off frequency should be maximum Fs/2 Hz
since the bandwidth of the original signal is maximum Fs/2 Hz.






On 10/13/2011 8:06 AM, manishp wrote:
> can anyone clarify which of the following is the right method for > re-sampling (sample rate conversion) > > method 1 > - up-sample by adding additional samples (usually 0) to the input samples > - convolve using a LPF > > method 2 > - up-sample by adding additional samples to the input samples > - pick up only selected samples (e.g. 1 in 10; 1 in 20 etc.) > > I am unable to appreciate about method 1 since sampling a signal at a > specific rate and filtering the low frequency components are two different > things. > > Method 2 looks more logical but in this method we are most likely to pick > up '0' valued samples more often than not. > > Can someone help me understand. The above example is for up-conversion.
Neither of the methods you describe are general. Conceptually, you could convert your signal to analog (i.e., continuous; quantization doesn't matter) and resample that at any rate you want. What you want is a mathematical method that efficiently simulates that. To keep the explanation simple, let's upsample by two; double the sample rate. What is needed is a new signal with twice as many samples in the same period of time. We can do this without introducing any new in-band energy by putting a new sample between each pair of old ones. (There are two choices for the new sample: zero, or a repeat of last old one. Both work. Try it.) So there's no new in-band energy, but lots out of band. Ouch! Not to worry: We know the original band edge, so just filter out everything above it. There is actually less out-of-band energy if we repeat samples, so sometimes there's a reason to do that. There are also reasons not to. Engineer's trade-off. Jerry -- Engineering is the art of making what you want from things you can get.

manishp wrote:

> can anyone clarify which of the following is the right method for > re-sampling (sample rate conversion) > > method 1 > - up-sample by adding additional samples (usually 0) to the input samples > - convolve using a LPF > > method 2 > - up-sample by adding additional samples to the input samples > - pick up only selected samples (e.g. 1 in 10; 1 in 20 etc.) > > I am unable to appreciate about method 1 since sampling a signal at a > specific rate and filtering the low frequency components are two different > things. > > Method 2 looks more logical but in this method we are most likely to pick > up '0' valued samples more often than not. > > Can someone help me understand. The above example is for up-conversion.
>On 10/13/2011 8:06 AM, manishp wrote: >> can anyone clarify which of the following is the right method for >> re-sampling (sample rate conversion) >> >> method 1 >> - up-sample by adding additional samples (usually 0) to the input
samples
>> - convolve using a LPF >> >> method 2 >> - up-sample by adding additional samples to the input samples >> - pick up only selected samples (e.g. 1 in 10; 1 in 20 etc.) >> >> I am unable to appreciate about method 1 since sampling a signal at a >> specific rate and filtering the low frequency components are two
different
>> things. >> >> Method 2 looks more logical but in this method we are most likely to
pick
>> up '0' valued samples more often than not. >> >> Can someone help me understand. The above example is for up-conversion. > > >Neither of the methods you describe are general. Conceptually, you could >convert your signal to analog (i.e., continuous; quantization doesn't >matter) and resample that at any rate you want. What you want is a >mathematical method that efficiently simulates that. > >To keep the explanation simple, let's upsample by two; double the sample >rate. What is needed is a new signal with twice as many samples in the >same period of time. We can do this without introducing any new in-band >energy by putting a new sample between each pair of old ones. (There are >two choices for the new sample: zero, or a repeat of last old one. Both >work. Try it.) > >So there's no new in-band energy, but lots out of band. Ouch! Not to >worry: We know the original band edge, so just filter out everything >above it. There is actually less out-of-band energy if we repeat >samples, so sometimes there's a reason to do that. There are also >reasons not to. Engineer's trade-off. > >Jerry >-- >Engineering is the art of making what you want from things you can get.
Hi John, Jerry, Can you answer one more question I have - Is sampling rate co-related to frequency components of the sampled signal?
On 10/13/2011 1:59 PM, manishp wrote:

   ...

> Can you answer one more question I have - > > Is sampling rate co-related to frequency components of the sampled signal?
I don't know what co-related means, and we can try to augment our vocabularies in another post. To make reconstruction possible, the sample rate must be at least a bit higher than the highest frequency in the signal being sampled. Jerry -- Engineering is the art of making what you want from things you can get.
On 10/13/2011 2:54 PM, Jerry Avins wrote:
> On 10/13/2011 1:59 PM, manishp wrote: > > ... > >> Can you answer one more question I have - >> >> Is sampling rate co-related to frequency components of the sampled >> signal? > > I don't know what co-related means, and we can try to augment our > vocabularies in another post. To make reconstruction possible, the > sample rate must be at least a bit higher than the highest frequency in > the signal being sampled.
That needs to be corrected and qualified. First of all, I meant to write _twice_ the highest frequency. Also, it assumes a baseband signal; one that extends (nearly) to 0 Hz. Narrow-band signals need to be sampled a bit faster than twice twice the bandwidth, and there are other constraints that need to be met. Jerry -- Engineering is the art of making what you want from things you can get.
>can anyone clarify which of the following is the right method for >re-sampling (sample rate conversion) > >method 1 >- up-sample by adding additional samples (usually 0) to the input samples >- convolve using a LPF > >method 2 >- up-sample by adding additional samples to the input samples >- pick up only selected samples (e.g. 1 in 10; 1 in 20 etc.) > >I am unable to appreciate about method 1 since sampling a signal at a >specific rate and filtering the low frequency components are two
different
>things. > >Method 2 looks more logical but in this method we are most likely to pick >up '0' valued samples more often than not. > >Can someone help me understand. The above example is for up-conversion. >
your two points as two methods don't make sense as two distinct concepts. upsampling is creating new samples that "fit" the signal without distorting it in the time or frequency domain. Ideally an analogue signal carries proper samples anywhere you sample from. Once it is sampled into digital domain then reconstructing new samples is arbitrary. There are a couple of methods to reconstruct new samples. You can find intermediate samples by interpolation e.g. in the simplest case you add one sample that is half way value between two existing samples (first order linear interpolator). Or you can increase order of interpolator to account for more adjacent samples to find the trend of signal better. In the digital design (FPGAs for example) we use your method 1 as interpolator of high order. we insert zeros then filter. The filter then generates the samples in between. Inserting zeros cleanly adds copies of original spectrum i.e. though it looks bizarre in the time domain with sudden changes towrds zero but in the frequency domain it adds well defined copies of signal spectrum, one copy per every extra zero inseted between two adjacent samples. So if you filter the resulting signal from the first copy onwards you force the filter to generate new samples smoothly in between any two original samples. Interpolation can also be useful in fractional delay. Here again you create new sample in between but not necessarily upsample. An ideal(but not practical) upsampler in digital domain can be thought of based on a sine table... I mean if you have a table of many sine values to choose from then say a 1MHz may require 100 samples per cycle. To upsample by two you just pick up 200 samples per cycle. Your sine frequency will stay 1Mhz on new double Fs. Upsampling here is clean because values are precomputed and is equivalent to ADC oversampling while that of digital filters carries a lot of mess in the spectrum floor, mess of copies residue and filter attenuation. Regards Kadhiem
>On 10/13/2011 1:59 PM, manishp wrote: > > ... > >> Can you answer one more question I have - >> >> Is sampling rate co-related to frequency components of the sampled
signal?
> >I don't know what co-related means, and we can try to augment our >vocabularies in another post. To make reconstruction possible, the >sample rate must be at least a bit higher than the highest frequency in >the signal being sampled. > >Jerry >--
Jerry, I am not sure if I am articulating correctly ... Assume we get a digital signal by sampling at a specific rate. Now we know that every signal can be synthesized from individual frequency components. So, is there a relation between sampling rate and the max frequency in the individual frequency component ...
On 10/14/2011 2:24 AM, manishp wrote:
>> On 10/13/2011 1:59 PM, manishp wrote: >> >> ... >> >>> Can you answer one more question I have - >>> >>> Is sampling rate co-related to frequency components of the sampled > signal? >> >> I don't know what co-related means, and we can try to augment our >> vocabularies in another post. To make reconstruction possible, the >> sample rate must be at least a bit higher than the highest frequency in >> the signal being sampled. >> >> Jerry >> -- > > Jerry, > > I am not sure if I am articulating correctly ... > > Assume we get a digital signal by sampling at a specific rate. > Now we know that every signal can be synthesized from individual frequency > components. So, is there a relation between sampling rate and the max > frequency in the individual frequency component ...
Did you see my corrected post? To make reconstruction possible for a baseband signal, the sample rate must be at least a bit higher than twice the highest frequency in the signal being sampled. If you need to ask that, I suggest that you have some reading to do. http://www.dspguide.com/pdfbook.htm would be a reasonable place to begin. Jerry -- Engineering is the art of making what you want from things you can get.