# Sample Rate & Highest Frequency

Would I be right in saying that if a signal was sampled every 0.2ms, when converting it to digital. The sampling rate would be 5000(Hz)?

How would I go about working out the highest frequency it would have using the sampling theorem?

If you sample every 0.2ms you collect 5000 samples per second and hence the sampling rate is 5000 Hz. According to Nyquist, this means the highest frequency the signal can have so we don't experience aliasing would be 2500 Hz.

Though that wasn't the question (it was about the sampling theorem explicitly), it's worth pointing out that that's only a theoretical limit. In practice, we need to go a bit higher (leave some room) for various reasons, including the fact that we can never observe an infinitely long signal, as correctly pointed out by the commenters.

• In practice you need a healthy margin between the highest usable frequency and Nyquist. How much margin really depends on the specific requirements of your application and how you implement your aliasing prevention. – Hilmar Sep 9 '19 at 17:11
• Half the sample rate only applies as the limit for infinite length signals and sampling durations in zero noise, e.g. never. – hotpaw2 Sep 10 '19 at 14:31
• Certainly. Nyquist talks about band-limited signals and time-limited signals can never be bandlimited signals. So if we're honest, bandlimited signals do not exist in practice so sampling will never be lossless. Yet, it doesn't have to be, we're typically fine with a limited accuracy in practice. – Florian Sep 10 '19 at 15:14
• I am confused about your comment, @Florian. To my knowledge, anti-aliasing measures limit the bandwidth of recorded signals in order to fulfill the Nyquist criterion. To me, these are band-limited, and are sampled without loss, but perhaps I'm forgetting about something? – Jonas Schwarz Oct 10 '19 at 22:24
• Also, shouldn't the criterion be <f_s/2, as opposed to ≤f_s/2? Sorry for the nitpicking but i think the f_s/2 case is at least depending on the phase of this signal frequency. – Jonas Schwarz Oct 10 '19 at 22:27

Maximum frequency

$$f_\mathrm{max} \le \frac{f_\mathrm{s}}{2}\tag{1}$$

so the sampling frequency normally chosen to overcome aliasing in recovering the signal

$$f_\mathrm{s} \geq 2 f_\mathrm{max}\tag{2}$$ Example

$$x(t)=\cos\left(2\pi (5000)t \right)$$

here $$f_\mathrm{max}=5000 \, \mathrm{Hz}$$, hence sampling frequency $$f_\mathrm{s} > 10000 H_z$$ is chosen to sample the analog signal $$x(t)$$ to get $$x[n]$$ with a relation $$x[n] \triangleq x(nT)\tag{3}$$

where $$T \triangleq \frac{1}{f_\mathrm{s}}$$.

The recovery of $$x(t)$$ from $$x[n]$$ without aliasing is possible when $$(2)$$ is met.

• the problem is that condition $(2)$ is not met with your example. if you change $$x(t)=\cos\left(2\pi (5000)t \right)$$ to $$x(t)=\sin\left(2\pi (5000)t \right)$$ then $$x[n]=x(nT)=0$$ for all $n$. but it surely isn't zero going in. – robert bristow-johnson Feb 7 at 21:52