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:


For the bk components:
There are 2 situations:
If k ≠ n


If k = n

For the ak components:
There are 3 situations:
If k ≠ n



as


If n = k

If k = 0


And so:
If n is odd

If n is even

With this the reconstructed function is:
If n is even

If n is odd

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[n].imag = peak/2;
if (n % 2 != 0)
}c[0].real = 0;
for (j = 1; j < 500; j++)
{
c[j].imag
= 0;
if ((n+j) % 2 == 0)
{
else
{
}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[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:

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


C# Demo Project Fourier signals