0
$\begingroup$

Fractional Resampler block in GNU Radio has parameter phase shift but there is a lack of information in which factors user has to provide this parameter (radians, degrees or samples?). There is only an error message providing and info that the range of this parameter should be set between 0 and 1. I have created simple simulation with the fractional resampler block to kinda 'debug' its behavior. There is an 100 length input vector consisting of zeros but one in the middle (50th index). Then there is an interpolatior with the RRC filter. Given 0 phase shift and 1 for resampling ratio the output from the interpolating FIR Filter and Fractional Resampler are not in line, meaning that original signal is delayed by 3 samples and to compensate this phenomena I needed to delay samples by 3 in the branch where Fractional Resampler exists. Question are:

  • Why 3 samples offset occurs?
  • How to interpret phase shift parameter from Fractional Resampler block?

I don't know if its relevant information but QT Time Sink has normal trigger set to 0.1.
I am enclosing the flowgraph and the source https://gist.github.com/marcinsztajn/afe03d05653864b10125fefe7d8b888d

The flowgraph enter image description here

$\endgroup$
2
$\begingroup$

"Phase shift" is poor terminology as time delay is not exactly the same, but the significance of the 0 to 1 factor is a fractional delay in units of samples.

The filter itself will always have additional delay, as a causal filter which is simply a processing delay independent of resampled delay as given by the phase shift parameter. For example a resampling delay of 0.5 will resample the original waveform such as to provide all new samples that are midway in between the current samples, and this new resampled waveform will be completely delayed by the filtering delay in time related to the input waveform.

The example in the figure below shows the original samples as blue dots of an underlying continuous time waveform as the line. If we used a "phase shift" parameter of 0.2, the samples as given by the red dots would be determined as the interpolated fractional delay values. These red dots would all be shifted even further to the right relative the original locations as shown in the lower plot due to the processing delay of the filter itself. (As we would see with any causal filter).

resampling

$\endgroup$
5
  • $\begingroup$ Thank you Dan. I understand that every filter has processing gain which is equal to N/2 -1, where N indicates the length of the filter, am I right? But in the figure I showed the original signal (unfiltered, original blue) is delayed with respect to the signal that is indented to be resampled (resampler output, red). Isn't that strange? $\endgroup$ May 7 '21 at 12:34
  • 1
    $\begingroup$ To clarify "processing gain" is something else, you mean "sample delay", and only linear phase filters have a delay that is equal to N/2-1. Yes that is strange that the resampled filter appears before the original. It is possible to realize negative group delays but in that case it would be the envelope of a waveform that appears earlier but not what you show. This must be a post-processing operation that truncated the beginning of the result. $\endgroup$ May 7 '21 at 12:40
  • $\begingroup$ Ah yes, sorry for my confusion, I truly meant 'processing delay'/'sample delay' instead of 'processing gain'. BTW. this delay (N/2 -1), does it come from symmetrical impulse response? According to the Fractional Resampling block, in that case I think that it should be used in serial not parallel as I did at my flowgraph, what do you think? $\endgroup$ May 7 '21 at 12:57
  • $\begingroup$ Yes a symmetrical impulse response will always have linear phase with a delay that is about it’s center. Yes given what you are seeing it seems it should be in series; have you tried? $\endgroup$ May 7 '21 at 17:31
  • $\begingroup$ Not yet, but this is a relevant information for me. Thanks Dan, helpful as always ;) $\endgroup$ May 8 '21 at 7:19

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.