# Fourier

Perform Fourier analysis of signal

## Library

Control and Measurements/Measurements

## Description

The Fourier block performs a Fourier analysis of the input signal over a running window of one cycle of the fundamental frequency of the signal. The Fourier block can be programmed to calculate the magnitude and phase of the DC component, the fundamental, or any harmonic component of the input signal.

Recall that a signal f(t) can be expressed by a Fourier series of the form

`$f\left(t\right)=\frac{{a}_{0}}{2}+\sum _{n=1}^{\infty }{a}_{n}\mathrm{cos}\left(n\omega t\right)+{b}_{n}\mathrm{sin}\left(n\omega t\right)$`

where n represents the rank of the harmonics. (n = 1 corresponds to the fundamental component.) The magnitude and phase of the selected harmonic component are calculated by these equations:

`$|{H}_{n}|=\sqrt{{a}_{n}^{2}+{b}_{n}^{2}}$`
`$\angle {H}_{n}=\text{atan}2\left(\frac{{b}_{n}}{{a}_{n}}\right)$`

where

`${a}_{n}=\frac{2}{T}\underset{t-T}{\overset{t}{\int }}f\left(t\right)\mathrm{cos}\left(n\omega t\right)dt$`
`${b}_{n}=\frac{2}{T}\underset{t-T}{\overset{t}{\int }}f\left(t\right)\mathrm{sin}\left(n\omega t\right)dt$`
`$T=\frac{1}{{f}_{1}}$`

As this block uses a running average window, one cycle of simulation must complete before the outputs give the correct magnitude and angle. For the first cycle of simulation, the outputs are held to the values specified by the initial input parameter.

## Dialog Box and Parameters

Fundamental frequency (Hz)

Specify the fundamental frequency, in hertz, of the input signal.

Harmonic n (0 = DC, 1 = fundamental)

Specify the harmonic component for the Fourier analysis. Enter 0 to analyze the DC component. Enter 1 to analyze the fundamental frequency, or enter a number corresponding to the desired harmonic.

Initial input [ Mag, Phase (degrees) ]

Specify the initial magnitude and phase in degrees of the output signal.

Sample time

Specify the sample time of the block, in seconds. Set to 0 to implement a continuous block.

## Inputs and Outputs

`Input`

Connect to the signal to be analyzed. Typical input signals are voltages or currents measured by Current Measurement or Voltage Measurement blocks.

|u|`Magnitude`

The first output returns the magnitude of the harmonic component specified, in the same units as the input signal.

$\angle \text{u}$`Phase`

The second output returns the phase, in degrees, of the harmonic component specified.

## Characteristics

 Sample Time Specified in the Sample Time parameterContinuous if Sample Time = 0 Scalar Expansion Yes, of the parameters Dimensionalized Yes

## Example

The `power_Fourier` model shows two applications of the Fourier measurement block. The upper part of the model shows how to use the Fourier block to compute the DC component, fundamental value, and second and third harmonic content of the same input signal. In the lower part of the model, the block computes the fundamental value (magnitude and phase) of three different inputs. For this application, specify initial values for the three output signals in the dialog box of the mask.

The model sample time is parameterized by the Ts variable set to a default value of 50e-6 s. Set Ts to 0 in the command window to simulate the model in continuous mode.