Sinus cut

The cut sinus signal is the output of a Dimmer or a thyristor driven AC controller. That’s one of the most frequent harmonics creators in the mains. :-)


Sinus
Sinus

For the ak elements:


Sinus

as


Sinus

Sinus Sinus


Sinus Sinus


Sinus SinusSinusSinus




If k > 1


Sinus

Sinus




And therefore

If k is odd


Sinus





K is even


Sinus





If k= 1


Sinus

Sinus





For the bk elements:


Sinus




as


Sinus


Sinus Sinus


Sinus Sinus


Sinus SinusSinusSinus




with


Sinus

Sinus




If k is odd


Sinus




If k is even


Sinus




If k = 1


Sinus

Sinus

Sinus

Sinus




Put into code that’s;


private void SinusCut(double peak, double alpha)
{
int j;
fft.c[0].real = 0;
for (j = 1; j < 500; j++)
{
if (j % 2 == 0)
{
fft.c[j].real = 0;
fft.c[j].imag = 0;
}
else
{
if (j == 1)
{
fft.c[j].real = peak / Math.PI / 2.0 * (Math.Cos(2.0 * alpha) - 1.0);
fft.c[j].imag = peak / Math.PI / 2.0 * (2.0 * (Math.PI - alpha) + Math.Sin(2.0 * alpha));
 
}
else
{
fft.c[j].real = peak / Math.PI * (Math.Cos(alpha * (1.0 - j)) / (1.0 - j) + Math.Cos(alpha * (1.0 + j)) / (1.0 + j) - 2.0 / (1.0 - j * j));
fft.c[j].imag = peak / Math.PI * (Math.Sin(alpha * (1.0 + j)) / (1.0 + j) - Math.Sin(alpha * (1.0 - j)) / (1.0 - j));
}
}
}
}





And the spectrum for α = 40° and the first 30 harmonics:

Sinus


Blue 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.
 

Sinus



C# Demo Project Fourier signals
  • FourierSignals.zip


  • Java Demo Project Fourier signals
  • FourierSignals.zip