- Introduction
The Digital Signal Processing (DSP) library supports Windows 32 and Windows 64 platforms. It uses General Purpose FFFT package. For instructions on how to install this library in your RAD Studio watch the video below.
2. Demonstrating the Components and What they Do
The DSP Demo is very simple. An OnPaint event of the main form is fired when the project is executed. DynArray is assigned, using the library function ‘SineWave’ with parameters – pixel points count and Sampling Frequency. To draw the sine wave are used Canvas properties for drawing lines using arithmetical formulas in a FOR cycle. The the Demo in action can been found in the next video.
1 2 3 4 5 6 7 |
Data := SineWave(1024, 1024 div 16); Middle := ClientHeight div 2; Canvas.Pen.Color := clGreen; Canvas.MoveTo(0, Middle); for I := 0 to Length(Data) - 1 do Canvas.LineTo(I, Middle - Round(Middle * Data[I])); |
To compute discrete Fourier transform (DFT) a TRealDFT object is created with parameter o constructor – the length of the ‘Data’ DynArray. The object itself calls its procedure ‘Compute’ which using the assigned ‘Data’.
1 2 3 4 5 6 |
with TRealDFT.Create(Length(Data)) do try Compute(Data); finally Free; end; |
Finally to draw the frequencies the same Canvas properties are used with another arithmetical formula in a FOR cycle.
1 2 3 4 5 |
Max := MaxValue(Data); Canvas.Pen.Color := clRed; Canvas.MoveTo(0, Middle); for I := 0 to Length(Data) - 1 do Canvas.LineTo(I, Middle - Round(Middle * Data[I] / Max)); |
The object inspector in Design time, can be seen on the images below:
You can download the DSP Library Demo here.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition
Why are all of the videos marked as “private”?