0
$\begingroup$

My design has symbol rate and sample rate to DAC fixed but the ratio is not an integer. For example assume my symbol rate is 3 Mbps but the sample rate to DAC is 20 Mbps. So i am having 3 MHZ and 20Mhz clock. Do I have to use a polyphase resampler in the Tx path to bring 3 Mbps to 4 Mbps and interpolate 5 times to 20 Mbps by RRC and then send it to DAC? Similarly on the receive side? or is there any better method?

$\endgroup$
1
$\begingroup$

The symbol rate is independent of the sampling rate. You can sample the symbols at any desired rate that is greater than twice the bandwidth of the symbol, where higher rates would simplify the required analog filtering after the DAC (so higher sampling is better in this regard and the initial ratios the OP is using are reasonable).

The bandwidth of each symbol is driven by the pulse shaping that may be used. With typical pulse shaping such as Raised Cosine, two samples per symbol would be a reasonable minimum sampling rate to use but would also require tighter analog filtering.

To see this, consider each “symbol” as it would appear as an analog waveform and observe how you can sample that any any rate as long as you observe Nyquist’s criteria to sample greater than twice the highest bandwidth of interest in the signal. Going from digital to analog with a DAC is this same process in reverse, in that how many samples do you need to properly reconstruct the desired waveform.

Assuming this design starts with symbols sampled at one sample per symbol at a 3 MHz symbol rate, typically this would be interpolated (upsampled by inserting zeroes and then filtered) where the filter would be the pulse shaping filter defined by the waveform transmitter specifications (often a root-raised cosine filter but must be defined). This upsampling could be matched to the transmitter sampling DAC frequency using polyphase resampling or done in stages. If in stages resampling to only 4 MBps would not be sufficient for pulse shaping given the explanation above, but it would be reasonable to resample to 10 MHz for pulse sampling and followed by 2x interpolation for the final DAC sampling.

$\endgroup$
7
  • $\begingroup$ @ Dan I understood your explanation but the issue is symbol rate and sample rate are not integer ratios. My symbol rate is 3 Mhz and DAC sample rate is 20 Mhz. Should I just register the 3 Mhz at 20 Mhz and send it to DAC ? No need to use a polyphase resampler? I have only 3 MHz and 20 Mhz clocks? So i cant derive any higher clocks either $\endgroup$
    – mark
    Jun 4 '20 at 11:46
  • $\begingroup$ @Mark there is no integer relationship required between the symbol rate and sampling rate. Are you saying that you just need to change sampling rates to match the rate of the DAC? You would need to upsample in order to pulse shape your symbols and that would also be done before the DAC - can you give more details on what you are doing about that? $\endgroup$ Jun 4 '20 at 11:57
  • $\begingroup$ Assuming my symbol rate is 3 MHz . If i am using RRC with upsampling by 4 the sample rate becomes 12 MHZ but my DAC sample rate is 20 MHz. So should i interpolate 12 Mhz 10 times to 120 Mhz and decimate by 6 to 20 Mhz and send to DAC? but i dont have these higher clocks? $\endgroup$
    – mark
    Jun 4 '20 at 12:07
  • $\begingroup$ @mark I see your question/issue and added another paragraph. Your prime factors are interpolate by 5x2x2 decimate by 3, so to allow BW for pulse shaping you could interpolate by 10 decimate by 3 interpolate by 2. Polyphase resampling is a good approach as you won't actually require the highest clock rate. You can do the pulse shaping after the 10/3 rate conversion or at the final 20 MHz output rate since you would need an interpolation filter there anyway. $\endgroup$ Jun 4 '20 at 12:14
  • $\begingroup$ @mark See with the 10/3 polyphase resampler for example how you never run at 30 MHz rate: You would have 10 polyphase filters with each filter output providing you what the sample would be if you were running at 30 MHz, but because of the subsequent decimation you only select every third output for each new output sample which would be at the 10 MHz rate. $\endgroup$ Jun 4 '20 at 12:19
0
$\begingroup$

Not to dissuade you from using integer ratios when you can (and you certainly can here), but to let people know that there is nothing mandatory about using integer ratios, despite the approach being the staple of DSP textbooks throughout decades—there is no actual requirement for integer ratios. Consider that resampling is conceptually equivalent to playing audio out a DAC at one rate, and resampling it by an ADC running at another rate. The lowpass filter of the DAC essentially calculates the continuous between-sample points, to be resampled by the ADC. There is no reason you can’t calculate the new-rate sample points from a software lowpass filter directly.

One method for implementing the lowpass filter is a windowed sinc function. The only requirement is that it’s a lowpass filter, but we generally want to preserve phase linearity and have a flat passband. I’ll use windowed sinc as an example because it’s popular, easy to compute, and has desirable qualities, but my main focus is the non-integer ratio aspect.

The advantage of integer-ratio conversion is that output samples are evenly spaced relative to the input samples. This means we can pre-compute a windowed sinc table with just the values we need. For a factor of four conversion, the table would have four sets of values corresponding to each step forward starting from one sample, before the next.

That is, for a factor of four, output sample #1 would correspond to the position of the first input sample, #2 with one-quarter way between the first two input samples, #3 half-way, #4 three-quarters way, and the cycle repeats—#5 coincident with the second input sample, and so on. So, 0, 0.25, 0.5, 0.75, step to next sample and repeat 1, 1.25, 1.5, 1.75, then 2, 2.25…always the same four positions between samples for the sinc table to be aligned to (and thus a simple application of a polyphase filter).

If you were to do this for an arbitrary ratio conversion, you would not have this simple repeating pattern. Let’s say the conversion factor is 3.9. Output sample #1 would be coincident with the first input sample, as before, but the following output samples would be spaced about 0.2564 from there. This means that there would be no output sample coincident with the second input sample, and the output samples between the second and third input samples wouldn’t be at the same fractional offsets as between the first and second input. 0, 0.2564, 0.5128, 0.7969, 1.0256, 1.2821, 1.5385, 1.7949, 2.0513…there is no simple repeating alignment of the table.

That's the problem with the table approach—it works well work integer ratio conversions, but isn’t suitable for non-integer ratios. Why do we use a table at all? Because it’s faster to look up the needed values from a pre-computed table that it is to calculate them on the fly, and each output sample requires many windowed-since evaluations.

One solution is to calculate an oversampled windowed sinc table, and interpolate arbitrary values between table values as needed. The accuracy is determined by the degree of oversampling of the windowed sinc table, and the quality of the interpolation. Windowed sinc is a relatively smooth function, so linear interpolation can be acceptable given a table with sufficient oversampling and dependent on your requirements.

Another reason you might not want to stick with integer ratios is when the sample rate might need small adjustments, such as locking to a physical clock source. A similar approach would be to upsample at a high integer rate then use a simpler interpolation between resulting intermediate output samples (note that you don’t necessarily need to actually produce ever sample at the higher rate, just the ones you need for further interpolation).

I hope this helps, conceptually if nothing else!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.