0
\$\begingroup\$

I have been given a time delay of a signal and the sampling frequency, however, I am trying to calculate the delay in samples. My logic is: delay frequency divided by sampling frequency, however, this doesn't give integer answers, which is what I expected as this is the time at which each sample is taken. However, if I do sampling frequency divided by delay frequency it gives integers for the sampling delay, but this doesn't make sense to me.

Could anyone please explain the conversion between delay in time and delay in samples.

Thank you.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Why are you talking about "delay frequency"? You have a delay (seconds) and a sampling frequency (samples / seconds). Just look at the units. \$\endgroup\$
    – Mat
    Commented Nov 15, 2021 at 23:07
  • \$\begingroup\$ So it's the sampling frequency divided by the delay time? @Mat \$\endgroup\$
    – Sputn1k
    Commented Nov 15, 2021 at 23:08
  • \$\begingroup\$ What are the units for what you propose? \$\endgroup\$
    – Mat
    Commented Nov 15, 2021 at 23:14
  • \$\begingroup\$ sampling frequency is in Hz and time delay in seconds \$\endgroup\$
    – Sputn1k
    Commented Nov 15, 2021 at 23:15

1 Answer 1

1
\$\begingroup\$

You know the time delay and the sampling frequency. The reciprocal of the sampling frequency is the time between samples. Thus if you divide the time delay by the time between samples (using the same units such as seconds), you will get the delay in units of sample periods. This should result in an integer (within the tolerances of the time delay and sampling frequency).

\$\endgroup\$
1
  • \$\begingroup\$ Right ok, this makes sense, and it works in giving integer values. Thank you very much \$\endgroup\$
    – Sputn1k
    Commented Nov 15, 2021 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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