# Alias frequency Formula

I'm taking a multimedia systems class in my MSc Computer Science, and I'm having some trouble understanding the formula for the alias frequency - this could stem from my misunderstanding of the alias signal.

My understanding of an alias signal is that if you undersample your input signal (i.e. sample at a rate which is less than twice the maximum frequency) then we can get aliasing because we're not sampling frequently enough to capture the high frequency details. The aliasing signal is the result of taking these sample values and joining them with a smooth curve.

Therefore, the resulting signal has a frequency of half the sampling frequency, since a pure sinusoid will need two samples per oscillation (1 for each turning point) - this would mean that the alias frequency should just be a function of the sampling frequency.

The formula for the alias frequency is the absolute difference of the signal frequency and the closest integer multiple of the sampling frequency - can someone explain this to me? Thanks in advance!

• one Example I would like to present for easy understanding Fs = 90 Hz , signal frequency fm =100 Hz then alias components are 1) !1Xfs- fm !=10 Hz 2) !2xfs-fm!=80 – Ys Rayudu May 17 '18 at 5:51

Suppose that the sampling is done at a rate of $1000$ Hz, one sample every millisecond. Suppose also that the signal being sampled is at $3200$ Hz, the first sample is at the peak of the sinusoid. The next sample, will be taken one millisecond later during which time the sinusoid will have gone through $3.2$ periods, and so the next sample will have the same value as if the sinusoid had gone through $0.2$ periods, not $3.2$ periods. The one after that will be $0.4$ periods away from the peak, and so on. This is exactly the same set of samples that we would gave gotten if we had been sampling a $200$ Hz sinusoid. In one millisecond it would have progressed through $0.2$ of its period of $5$ milliseconds and so on. In other word, just by looking at the samples alone we cannot tell whether the samples came from a $3200$ HZ signal or from a $200$ Hz signal.

If the signal being sampled was at $2800$ Hz, then we would get samples corresponding to $0$, $-0.2$ of the period, $-0.4$ of the period and so on. But because sinusoids look the same in either direction in time, these samples also look like they are the result of sampling a $200$ Hz signal. This is the reason why the formula you are given, viz.

Aliased frequency is the absolute difference between the actual signal frequency and the nearest integer multiple of the sampling frequency.

works to give you the right answer.

If you sample a signal at too low a sampling rate, you won't necessarily get alternating samples. You could end up sampling only near the tops (for awhile), or only bottoms, or only zero crossings, etc., which would look like samples of a "smooth" waveform of a much lower frequency than at some fixed value such as half the sampling frequency.

• I disagree with this characterization. If the sampling rate is too low, you get one sample from one period of a sinusoid (say at the peak) and the next sample is from a different period and is off-peak. The next one after that is from a yet later period of the sinusoid, and is even more off-peak etc. The successive samples will look like a sinusoid at a different frequency. – Dilip Sarwate May 24 '12 at 18:51
• If the sampling rate is exactly 10X or 100X lower than the frequency of a sampled sinewave, and you get one peak, everything else you get will be a peak (of the 10th or 100th cycle later). Vary the frequencies just slightly, and eventually, perhaps many many samples later, you will get a sample with a different sign. – hotpaw2 May 24 '12 at 19:10
• I think you are missing the point of my comment. Sampling a signal that is at frequency that is an integer multiple of the sampling rate will give you the same point every time, not as you say "You could end up sampling only tops (for awhile), ..." (emphasis added); you will always sample the top (or same point) and alias down to $0$ Hz, there is no awhile; it is for ever and ever. – Dilip Sarwate May 24 '12 at 19:15
• @Dilip : Pedantic. 0 Hz != Fs/2, which answers the question. And awhile includes an infinite while. But I changed tops to "near the top". – hotpaw2 May 24 '12 at 20:01
• "0 Hz != Fs/2." Do your systems interpret the sequence $1,1,1,1,\ldots$ as samples of a signal at half the sampling frequency or just plain vanilla DC? How about the sequence $+1,-1,+1,-1,\ldots$? – Dilip Sarwate May 24 '12 at 20:05

Perhaps this animation (warning: 100MB file!) may help. I made it for a friend of mine to explain what aliasing is. I set the sampling frequency $fs = 10\text{Hz}$. Then I run a signal from $0$ up to $30\text{Hz}$. The concept that Dilip Sarwate explains in the above answer is I believe visible in this animation (at least I hope it is :) ).

For example if the signal is of $f = 21\text{Hz}$ and is sampled with $fs = 10\text{Hz}$, then the resulting (aliased) frequency would be $|n*fs - f| = |2*10 - 21| = 1\text{Hz}$. In animation, this is like a full 1 cycle of a $\text{cos}$ function (in animation), exactly as if the signal was of $f = 1\text{Hz}$. The exact same effect occurs when frequency $f$ is e.g.: 9Hz, 11Hz, 19Hz, and 29Hz, etc.

In animation, the green line represents original signal whereas the red dashed line is the result due to aliasing. There's also a dotted cos function at 5Hz. It simply represents the $\text{cos}$ at its maximal frequency 5Hz. The red points are where sampling occurs. I have chosen the $\text{cos}$ but it can work for a $\text{sin}$ function, either. The only difference is that, when $\text{sin}$ is aliased, signal is phase shifted by $180 ^\circ$ because $\text{sin}$ is an odd whereas $\text{cos}$ is an even function.

I hope, it will help to understand the formulae.

PS. If you cannot open the animation, please try to download this MATLAB script. It will produce a number of frames in TIFF format in folder ./animation--I think this folder has to exist. It uses imwrite function just in case someone would like to make some changes.

PS2. I wanted to put more links but I could not. I wanted to give you a link to MATLAB script and imwrite function I used when I was making this animation but SE does not let me do it. I will edit this answer when I am able to :)

• Hi! The dropbox link you provided is broken. If you still have that file, could you share it. It would be helpful. Thanks. – bikalpa Jul 24 '19 at 4:08
• Hi. I wiped everything from Dropbox and don't have this file anymore. I should have placed code here instead of linking a file. Sorry. I found this link which demonstrate alliancing in a similar way: youtube.com/watch?v=sSrfq7uvkZ4 – Celdor Jul 24 '19 at 13:21