Block: Sin3Gen



PIC




Inports


A

Amplitude



f

Frequency






Outports


u

Sine wave output phase u



v

Sine wave output phase v



w

Sine wave output phase w






Mask Parameters


fmax

Maximum Frequency in Hz



Offset

Offset



ts_fact

Multiplication factor of base sampling time (in integer format)




Description:

Generation of a 3 sine waves with amplitude (A) and frequency (f).

Calculation fixed point implementation:

uk = Ak sin (2fkfmaxkTs ) + Aoffset
vk = Ak sin (               2π)
  2fkfmaxkTs -  ---
                3 + Aoffset
wk = Ak sin (                 )
                2π
  2fkfmaxkTs +  ---
                3 + Aoffset

For sine calculation a lookup table with 256 entries is used. This results in a short computation time but with the downside of reduced accuracy for the FiP32 implementation.

Calculation floating point implementation (parameter f_max is ignored):

uk = Ak sin (2πfkkTs ) + Aoffset
vk = Ak sin (            2π)
  2πfkkTs -  ---
             3 + Aoffset
wk = Ak sin (              )
             2π
  2πfkkTs +  ---
             3 + Aoffset

Implementations:
FiP16 16 Bit Fixed Point Implementation
FiP32 32 Bit Fixed Point Implementation
Float32 32 Bit Floating Point Implementation
Float64 64 Bit Floating Point Implementation

Implementation: FiP16


16 Bit Fixed Point Implementation



Inports Data Type


A

int16



f

int16






Outports Data Type


u

int16



v

int16



w

int16




Implementation: FiP32


32 Bit Fixed Point Implementation



Inports Data Type


A

int32



f

int32






Outports Data Type


u

int32



v

int32



w

int32




Implementation: Float32


32 Bit Floating Point Implementation



Inports Data Type


A

float32



f

float32






Outports Data Type


u

float32



v

float32



w

float32




Implementation: Float64


64 Bit Floating Point Implementation



Inports Data Type


A

float64



f

float64






Outports Data Type


u

float64



v

float64



w

float64