# Fractional delay in fractional resampler block

**URL:** <https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029>\
**Category:** GNU Radio\
**Created:** [November 12, 2014, 2:51pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029 "2014-11-12T14:51:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 12, 2014, 2:51pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/1 "2014-11-12T14:51:44Z")

</div>

Hello,

I have in my project a sample rate of 10.23 million samples per second  
and  
I need to delay the signal ±1ns. With GNURadio block delay I can delay  
the  
signal 97.75ns (1 / 10,230,000 -\> + - one sample).

Could I use the fractional resampler block to enter a variable  
fractional delay?  
Has anyone implemented a fractional delay block?

Thank you.

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 12, 2014, 3:33pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/2 "2014-11-12T15:33:33Z")

</div>

well, yes, you could, but that sounds ugly:

1. a sample rate of 1e9Hz implies --for complex float-- a memory  
consumption of 1e9\*8B~=8GB per second…
2. unwieldy fractional resampling, because 10.23e6 and 1e9 don’t have a  
very large common divisor; you’ll be interpolating by a factor of 100000  
just to decimate by 1023… That is effectively just very very many  
samples in-between.
3. you’re sampling at 10.23MS/s, but you want to do something with a  
temporal resolution of 10 times that rate; that’s a phase shift, for  
sure, but I’m afraid that it sounds like you’re trying to harm Nyquist  
in some way or another.

When were talking on how to simulate delay introduced by radar range in  
GNU Radio, a wise[1] elder[2] told me to do time shifting in frequency  
domain:

The idea is that a time shift corresponds to frequency shift in  
frequency domain, so you can, within the spectral precision defined by  
the length of your DFT, have arbitrary shifts by doing [time  
signal]-\>[DFT]-\>[multiply with complex sine]-\>[IDFT] . Note that, due to  
the circular nature of the DFT, this will distort the first samples of  
the output.

Greetings,  
Marcus

[1] one might consider him wise  
[2] not really an elder

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 17, 2014, 12:25pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/3 "2014-11-17T12:25:54Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 17, 2014, 2:27pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/4 "2014-11-17T14:27:36Z")

</div>

Hi Carlos,  
yes, your formular looks correct, scalar multiplication aside.

Regarding your problem:  
It’s not a problem, it’s a feature 🙂  
you’re using window functions in your FFT, that’s what’s changing your  
signal.  
The FFT is but an implementation of the DFT (discrete fourier  
transform), which is, considering the input as element of a  
n\_fft-dimensional vector space, is but a base change, and thus has an  
inverse – the IDFT (incarnated by the IFFT).

what you see is something like the norm of the square of the window  
function; use “rectangular” to avoid this.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 19, 2014, 9:05am UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/5 "2014-11-19T09:05:23Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 19, 2014, 2:58pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/6 "2014-11-19T14:58:46Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 28, 2014, 5:18pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/7 "2014-11-28T17:18:00Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 28, 2014, 6:01pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/8 "2014-11-28T18:01:05Z")

</div>

Hello Carlos,

I don’t really think that what you built really reflects what you’re  
trying to achieve: I thought you needed a really small delay in time  
domain, and a sampling rate conversion from 10MHz to 10.23MHz.

Why are you doing a delay in frequency domain? That will simply be a  
frequency shift in time domain, which you could easily realize (and with  
much smaller computational error) by multiplying with a complex sine in  
time domain.

I don’t really understand what you mean with “small variable delay in  
the receiver”: Do you mean your system is not somehow synchronized?

Best regards,  
Marcus Müller

---

<div class="post-metadata">

**Author:** ![Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/34f0e0/32.png) [@Carlos\_Alberto\_Ruiz](https://www.ruby-forum.com/u/Carlos_Alberto_Ruiz)\
**Post date:** [November 28, 2014, 6:13pm UTC](https://www.ruby-forum.com/t/fractional-delay-in-fractional-resampler-block/233029/9 "2014-11-28T18:13:50Z")

</div>

Hi Carlos,  
I just realized that maybe the core problem here is that I don’t really  
understand what you’re trying to do –  
could you explain what this system will be used for, and why you need  
that particular sampling rate etc?

Best regards,  
Marcus
