Alias effect happens when the Shannon sampling theorem is not satisfied. The measured frequency is lower than the real frequency, what’s more the calculation of mode number will also be affected. Thus, when using diagnostics data, you must make sure whether you data is valid under proper sampling frequency.

Alias Phenomenon

When the sampling rate of a signal is below the requirement of Shannon sampling theorem (Fs>2fmaxF_s>2f_{max}), the measured frequency will not correctly remain the original frequency of the signal. This error in frequency is called alias. Alias phenomenon is common in our real life. For example, when a wheel is rotating fast enough, we can really see alias with our eyes. Because human eye can only pick up an image below 60 Hz. Which is to say, the sampling rate is Fs=60 Hz, when the wheel rotate higher than Fs/2=30 Hz, we will see alias as if the wheel is rotating backward.

But what is the relation between the real world signal frequency and the alias frequency? Answer this question will help us correctly understand the power spectrum of a signal and discover the real MHD mode in the field of fusion plasma experiment.

Since any real world time changing signal can be treated as a function which can be Fourier decomposed as sine and cosine function series. If we can understand the alias sampling of a sine function, we can understand the alias of the real signal.

Sampling of Sine Wave

The alias of frequency for sine function originates from the periodicity of sine function. This has been vividly shown in the picture from the lecture notes of professor Mark A. Wickert [2]. The detailed mathematics goes below.

Say we have a sine function signal with frequency ω1\omega_1 as: sin(ω1t+ϕ1)sin(\omega_1 t+\phi_1). If we sampled this signal as: tn=nΔt_n=n\Delta, n=0,1,2,3,…, where Δ\Delta is the sampling interval, then sampling rate is: Fs=1ΔF_s=\frac{1}{\Delta}. The sampled sine function becomes discrete as: sin(ω1tn+ϕ1)=sin(ω1nΔ+ϕ1)sin(\omega_1 t_n +\phi_1)=sin(\omega_1 n\Delta+\phi_1). Then how does alias occur? The answer comes from the periodicity of sine function. We have periodic relation for sine function as: sin(x)=sin(x+2kπ)sin(x)=sin(x+2k\pi), where k is an integer number. Thus we apply this relation to the sampled function and get the relation:

sin(ω1nΔ+ϕ1)=sin(ω1nΔ+ϕ1+2πkn)=sin((ω1+2πk/Δ)nΔ+ϕ1)=sin(2π(f1+kFs)+ϕ1) \begin{array}{l l} sin(\omega_1 n\Delta+\phi_1) &=sin(\omega_1 n\Delta+\phi_1+2\pi kn)\\ &=sin((\omega_1+2\pi k/\Delta)n\Delta+\phi_1)\\ &=sin(2\pi(f_1+kF_s)+\phi_1) \end{array}

Where ω1=2πf1\omega_1=2\pi f_1 is the angular velocity. If we suppose the f1=faf_1=f_a is the signal we measure after discrete sampling and f0f_0 is the real world frequency of the signal. Then any real signal with frequency f0f_0 will be sampled as alias frequency within the Nyquist frequency range (FNyq=Fs/2F_{Nyq}=F_s/2) determined by sampling rate. Which is: fa[0,FNyq]=[0,Fs/2]f_a\in [0,F_{Nyq}]=[0,F_s/2]. Then the relation between alias frequency and real frequency is:

f0=fa+kFsfa=f0kFs \begin{array}{ll} & f_0=f_a+kF_s\\ \Rightarrow & f_a = f_0 - kF_s \end{array}

Since fa[0,Fs/2]f_a\in [0,F_s/2], we have f0=fa+kFs[(k1)Fs,(k1/2)Fs]f_0=f_a+kF_s \in [(k-1)F_s,(k-1/2)F_s], where k=0,1,2,3,… . That is:

fa=f0(k1)Fs ,(k1)Fsf0(k1/2)Fs ,k=1,2,3,... f_a=f_0-(k-1)F_s\ ,(k-1)F_s \leq f_0 \leq (k-1/2)F_s\ ,k=1,2,3, ...

If we also consider the relation of sine function: sin(x)=sin(πx)sin(x)=sin(\pi-x), we can get this relation:

sin(ω1nΔ+ϕ1)=sin(π(ω1nΔ+ϕ1))=sin(π(ω1nΔ+ϕ1)+2πkn)=sin(2π(kFsf1)nΔ+πϕ1) \begin{array}{l l} sin(\omega_1 n\Delta+\phi_1) &=sin(\pi-(\omega_1 n\Delta+\phi_1))\\ &=sin(\pi-(\omega_1 n\Delta+\phi_1)+2\pi kn)\\ &=sin(2\pi(kF_s-f_1)n\Delta+\pi-\phi_1) \end{array}

Like the derivation of equation (\ref{ramp_alias_freqeuncy}), we can get the relation between the alias and the real frequency under this condition as:

f0=kFsfafa=kFsf0 \begin{array}{l l} & f_0=kF_s-f_a\\ \Rightarrow & f_a=kF_s-f_0 \end{array}

Similarly the range of f0f_0 is: f0[(k1/2)Fs,kFs]f_0 \in [(k-1/2)F_s,kF_s], where k=1,2,3,… . That is:

fa=kFsf0 ,(k1/2)Fsf0kFs ,k=1,2,3,... f_a=kF_s-f_0\ ,(k-1/2)F_s \leq f_0 \leq kF_s\ ,k=1,2,3,...

Altogether, the relation between alias frequency and real frequency is:

fa=f0(k1)Fs(k1)Fsf0(k1/2)FskFsf0(k1/2)Fsf0kFsf_a= \begin{array}{l} f_0-(k-1)F_s &(k-1)F_s \leq f_0 \leq (k-1/2)F_s\\ kF_s-f_0 &(k-1/2)F_s \leq f_0 \leq kF_s\\ \end{array}

Where k=1,2,3,… . is positive integer number.

Alias in Spectrum

With above derivation, we can easily understand the alias behavior in spectrum.

First we can see the alias frequency changing with sampling frequency, we hold f0f_0 as constant, and change the sampling frequency. Then we can get this simulation result:

alias frequency with ramped ,

From this picture we can see the alias frequency is small than the real signal frequency. When the sampling frequency is higher than 2f02f_0, the sampled frequency is actually the signal frequency. As the sampling frequency reduces below it, the alias frequency begins to ramp up and down many times and getting smaller and smaller.

Then we hold the sampling frequency as constant and ramp the signal frequency, we can get this simulation result:

Alias frequency with ramped  from 0 to 40000 Hz, Fs=10000 Hz

This shows that as the f0f_0 ramps up, the alias ramps zigzag within the range of Nyquist frequency [0,Fs/2][0,F_s/2].

To test this result, we create a signal with ramped frequency as: f0=20000tf_0=20000*t, which means its frequency with ramp from 0 to 20000 Hz. And we set the sampling frequency as Fs=10000HzF_s=10000 Hz, then we do the short time Fourier transform to calculate its power spectrum. We get this result:

power spectrum of alias signal, Fs=10000 Hz, f0 from 0 to 40000 Hz

{\color{blue} Why alias appear with MDSplus down sampling?}
Because using MDSplus down sampling is like to do down sampling to the original signal without filter. Then the alias do appear. So if you want to totally avoid alias, you need to do filter every time you make a sampling. But you certainly loses the alias part of signal.

Alias Effect on Mode Number Calculation

What is the effect of alias sampling on mode calculation?

To answer this question we take a look on the calculation of toroidal mode numbers on EAST Mirnov signal.

The calculation of toroidal mode number n take signals from two Mirnov coils. We note them as signal: sig1(t),sig2(t), there toroidal angular distance is Δθ\Delta\theta. If we do short time discrete Fourier to the two signals we can get the phase of the two signal as ϕ1,ϕ2\phi_1,\phi_2. Then the phase shift between the two signal will be Δϕ=ϕ2ϕ1\Delta\phi=\phi_2-\phi_1, then the toroidal mode number is: n=[Δϕ/Δθ]n=[\Delta\phi/\Delta\theta]. The [][] here means to take the closest integer value.

Understand the process of mode number calculation, we can analytically discuss the alias effect on mode number. First, suppose the signals have the form: sig1(t)=sin(ωt+ϕ1),sig2(t)=sin(ωt+ϕ2)sig1(t)=sin(\omega t+\phi_1), sig2(t)=sin(\omega t+\phi_2), their toroidal angular distance is Δθ\Delta\theta, then after alias sampling with Fs=1/ΔF_s=1/\Delta, Then with the discussion in section 2, they becomes this:

  • when f0=fa+kFs[(k1)Fs,(k1/2)Fs]f_0=f_a+kF_s \in [(k-1)F_s,(k-1/2)F_s]

sig1(tn)=sin(2π(fa+kFs)nΔ+ϕ1)sig2(tn)=sin(2π(fa+kFs)nΔ+ϕ2) \begin{array}{l l} sig1(t_n)=sin(2\pi(f_a+kF_s)n\Delta+\phi_1)\\ sig2(t_n)=sin(2\pi(f_a+kF_s)n\Delta+\phi_2) \end{array}

Thus the mode number becomes: n1=ϕ2ϕ1Δθ=n0n_1=\frac{\phi_2-\phi_1}{\Delta\theta}=n_0, which is same as the mode number with correct sampling.

  • when f0=kFsfa[(k1/2)Fs,kFs]f_0=kF_s-f_a \in [(k-1/2)F_s,kF_s]

sig1(tn)=sin(2π(kFsfa)nΔ+πϕ1)sig2(tn)=sin(2π(kFsfa)nΔ+πϕ2) \begin{array}{l l} sig1(t_n)=sin(2\pi(kF_s-f_a)n\Delta+\pi-\phi_1)\\ sig2(t_n)=sin(2\pi(kF_s-f_a)n\Delta+\pi-\phi_2) \end{array}

Thus the mode number becomes:

n=(πϕ2)(πϕ1)Δθ=ϕ2ϕ1Δθ=n0n=\frac{(\pi-\phi_2)-(\pi-\phi_1)}{\Delta\theta}=-\frac{\phi_2-\phi_1}{\Delta\theta}=-n_0

Altogether, we have the relation for mode number of alias sampling, suppose n0n_0 is the real toroidal mode number, and nn is the mode number we calculated after alias sampling. We have:

n=n0(f0=fa+kFs[(k1)Fs,(k1/2)Fs])n0(f0=kFsfa[(k1/2)Fs,kFs]) n= \begin{array}{l} n_0 & (f_0=f_a+kF_s \in [(k-1)F_s,(k-1/2)F_s])\\ -n_0 & (f_0=kF_s-f_a \in [(k-1/2)F_s,kF_s])\\ \end{array}

The simulation result also agrees with our derivation.

alias sampling's effect on mode number

Further calculation of n=-8,-7,…,3,2 also satisfy with our formula. Thus the simulation agrees perfectly with our prediction.

Resampling

With MDSplus database, we can resample the signal with a certain time points intervals. But here, special attention should be given to this operation. If you do a resampling with more than one points, then you must perform like this:

* calculate the Nyquist frequency under your new sampling rate.
* Low-pass filter the original signal according to the new sampling rate.
* pick up filtered signals with certain index intervals according to your resampling setting.

Only in this way, can you get ride of the alias in your resampled signal.
Normally, people take 5 times the highest f signal as sampling frequency: which is Fs=5f0 (the 5 times relation is the experience told by MIT people who do the MDSplus).

Alias Effects on Frequency and Mode Number

From the above results, we can clearly see that if the measured frequency of a mode do not change with the increase or decrease of sampling frequency, then our frequency measurement is correct.

  • alias frequency formula is derived.
  • simulation matches with theory prediction in alias spectrum.
  • if a mode frequency do not change with sampling, it is correct.
  • the mode number only change its sign with alias sampling.
  • we can use alias signal in poloidal Mirnov array to calculate high frequency mode’s poloidal mode number m.

Question: How to predict real frequency from alias frequency?

From previous derivation we can see that:f0=kFs±fa,k=0,1,2,3,...f_0=kF_s\pm f_a, k=0,1,2,3,... (Where f0>0f_0>0 and faf_a is the frequency we measured from spectrum). Maybe you need to make a good guess to k.

Finally, a refined summary with additional discussion about alias MHD mode strength is published as an arXiv preprint paper [3].

Reference

[1] National Instruments cooperation (NI), white paper, introduction of signal aliasing: http://www.ni.com/white-paper/3000/en/

[2] Mark A. Wickert, University of Colorado Springs, Introduction to Signals and Systems: ECE 2610 lecture Notes, chapter 4, Spring 2011. http://www.eas.uccs.edu/~mwickert/ece2610/lecture_notes/ece2610_chap4.pdf

[3] N. Chu, “Alias sampling effect on the calculation of MHD mode number in fusion plasma,” (2019), arXiv:1910.09181 physics.plasm-ph.