Amplitude-shift keying sign

Amplitude shift keying is a form of amplitude modulation used to transmit digital data over optical fiber or another media. The digital information is transmitted like a fixed-amplitude carrier for 1 and 0 for 0. A 1, 0 sequence looks like:



Ask
Ask

For the bk components:

There are 2 situations:

If k ≠ n


Ask
Ask


If k = n


Ask




For the ak components:

There are 3 situations:

If k ≠ n


Ask

Ask

Ask

as



Ask


Ask



If n = k


Ask





If k = 0


Ask
Ask



And so:

If n is odd


Ask


If n is even


Ask



With this the reconstructed function is:

If n is even


Ask



If n is odd

Ask



Put into a function with ak as real part and bk as imaginary part:



private void Ask(double peak, int n)
{
int j;
c[0].real = 0; 
for (j = 1; j < 500; j++)
{
c[j].imag = 0;
if ((n+j) % 2 == 0)
{
c[j].real = 0;
}
else
{
if (j != n)
c[j].real = peak / Math.PI * 2.0 * (double)n / ((double)n * (double)n - (double)j * (double)j);
else
c[j].real = 0;
}
}
c[n].imag = peak/2;
if (n % 2 != 0)
c[0].real = peak / Math.PI / (double)n;
}



That creates for n=4 a spectrum like:

Ask

With the blue bars are the real elements and red the imaginary parts


And if all the harmonics are put together, we get the signal shape:



The brightest line is the base frequency. The next darker is the base frequency plus the first harmonic, then comes the same plus the next harmonic … and so on. The more harmonics are included, the closer the shape approximates the origin shape :-)


C# Demo Project Fourier signals
  • FourierSignals.zip


  • Java Demo Project Fourier signals
  • FourierSignals.zip