⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 help.htm

📁 VCL component dsplab , STFT and SPECTRUM viewer, real time
💻 HTM
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Delphi components for digital signal processing</title>
  <meta http-equiv="Content-Type" content="text/html">
  <meta name="AUTHOR" content="Eugen Tarasov">
  <meta name="COPYRIGHT"
 content="Copyright (c) 2002-2006 by Eugen Tarasov">
  <link rel="stylesheet" href="main.css">
</head>
<body style="background-color: rgb(255, 255, 255);">
<table border="0" width="100%">
  <tbody>
    <tr>
      <td class="dspmaintitle" width="75%">DSPLab for Delphi</td>
      <td class="menuitem" width="25%"> <br>
      </td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
  </tbody>
</table>
<table border="0" width="100%">
  <tbody>
    <tr>
      <td class="separator" width="13">
      <p class="dsptitle">&nbsp;</p>
      </td>
      <td width="980">
      <p class="dsptitle">Description</p>
      <p class="dsptext"><a href="#LibContent">Components Overview</a><br>
      <a href="#Units">Units</a><a href="#GF"><br>
Global functions</a><a href="#LibContent"><br>
      </a><a href="#DataTypes">Data types</a> <br>
      <a href="#Samples">Examples</a><br>
      </p>
      <p class="dspsubtitle"><a name="LibContent"></a>Components
Overview</p>
      <blockquote>
        <p class="dsptext"> The library contains two components:<br>
        <br>
        <a href="#TdspIIRFilter">TdspIIRFilter</a> - Implementation of
the Infinite Impulse Response filter<br>
        <a href="#TdspButterworthFilter">TdspFFT</a> - Implementation
of Fast Fourier Transform <br>
        </p>
      </blockquote>
      <p class="dspsubtitle"><a name="Units"></a>Units </p>
      <blockquote>
        <p class="dsptext">dspIIRFilters.pas - contains the
implementation of TdspIIRFilter component<br>
dspFFT.pas - implementation of TdspFFT component<br>
dspTypes.pas - contains the base types<br>
dspComplex.pas - set of functions to work with complex numbers<br>
dspWindow.pas - implementation of window functions</p>
      </blockquote>
      <p class="dspsubtitle"><a name="GF"></a>Global functions</p>
      <blockquote>
        <p class="dspsubtitle">Unit dspWindow</p>
        <blockquote>
          <p class="dspsubtitle">function dspGetWindowValue(Window:
TdspWindow; Index, Length: Integer): TdspSingle;</p>
          <p>This function returns the window value for specified
window function at the Index position. The Length parameter specifies
the window
length. <br>
          <br>
          <span class="dspsubtitle">procedure
dspCalculateWindow(Window: TdspWindow; Data: PdspSingle; Length:
Integer); </span></p>
          <p>This procedure calculates the window values for specified
Window function. The values will be stored in the Data parameter. The
window length and length of data are specified in the length parameter.<br>
          <br>
          <span class="dspsubtitle">procedure dspApplyWindow(Window:
TdspWindow; Data: PdspSingle; Length: Integer); </span><br>
          <br>
This procedure applies the specified window to the data. The length
parameter is the window length.</p>
        </blockquote>
        <p class="dspsubtitle">Unit dspComplex</p>
        <blockquote>
          <p> <span class="dspsubtitle">function cmpxInit (Re:
TdspFloat; Im: TdspFloat = 0.0): TdspComplex; overload;</span><br>
This function converts Re and Im to complex<br>
          <br>
          <span class="dspsubtitle">procedure cmpxInit (var Z:
TdspComplex; Re: TdspFloat; Im: TdspFloat = 0.0); overload;</span><br>
This procedure converts Re and Im to complex Z<br>
          <br>
          <span class="dspsubtitle">function cmpxNeg (Z: TdspComplex) :
TdspComplex; </span><br>
This function returns negated value of complex number<br>
          <br>
          <span class="dspsubtitle">function cmpxSqr (Z: TdspComplex) :
TdspComplex; </span><br>
This function returns the square of Z<br>
          <br>
          <span class="dspsubtitle">function cmpxSqrt (Z: TdspComplex)
: TdspComplex;</span><br>
This function returns the square root of Z<br>
          <br>
          <span class="dspsubtitle">function cmpxSqrtx (V: TdspFloat) :
TdspFloat; </span><br>
This function returns the square root of V. If V &lt; 0 then function
returns 0.<br>
          <br>
          <span class="dspsubtitle">function cmpxExp (Z: TdspComplex) :
TdspComplex;</span><br>
This function returns exponent raised to Z (e^Z)<br>
          <br>
          <span class="dspsubtitle">function cmpxExpj (V: TdspFloat)
: TdspComplex; </span><br>
This function returns exponent raised to jV (e^jV)<br>
          <br>
          <span class="dspsubtitle">function cmpxHypot (Z: TdspComplex)
: TdspFloat;</span><br>
This function returns the hypotenuse of Z. <br>
          <br>
          <span class="dspsubtitle">function cmpxArcTan2 (Z:
TdspComplex) : TdspFloat;</span><br>
This function returns the arctan of Z<br>
          <br>
          <span class="dspsubtitle">function cmpxConj (Z: TdspComplex)
: TdspComplex;</span><br>
This function returns conjugate of Z<br>
          <br>
          <span class="dspsubtitle">function cmpxMul (Z: TdspComplex;
V: TdspFloat) : TdspComplex; overload;</span><br>
This function multiplies a complex and a real<br>
          <br>
          <span class="dspsubtitle">function cmpxMul (Z1, Z2:
TdspComplex) : TdspComplex; overload;</span><br>
This function multiplies two complex numbers<br>
          <br>
          <span class="dspsubtitle">function cmpxDiv (Z: TdspComplex;
V: TdspFloat) : TdspComplex; overload;</span><br>
This function divides Z with R<br>
          <br>
          <span class="dspsubtitle">function cmpxDiv (Z1, Z2:
TdspComplex) : TdspComplex; overload;</span><br>
This function divides two complex numbers<br>
          <br>
          <span class="dspsubtitle">function cmpxAdd (Z1, Z2:
TdspComplex) : TdspComplex;</span><br>
This function adds two complex numbers<br>
          <br>
          <span class="dspsubtitle">function cmpxSub (Z1, Z2:
TdspComplex) : TdspComplex;</span><br>
This function substracts two complex numbers</p>
        </blockquote>
      </blockquote>
      <p class="dspsubtitle"><a name="DataTypes"></a>Data types</p>
      <blockquote>
        <p class="dsptext"> <a name="FilterOrder"></a><b>TdspIIRFilterOrder</b>
= 1..8<br>
The order of IIR filter.</p>
        <p class="dsptext"> <b><a name="IIRFilterKind"></a>TdspIIRFilterKind</b>
= (fkButterworth, fkChebyshev, fkBessel)<br>
The characteristics of IIR filter.</p>
        <p class="dsptext"> <b><a name="IIRFilterResponse"></a>TdspIIRFilterResponse</b>
= (ftLowpass, ftHighpass, ftBandpass, ftBandstop)<br>
The frequency response of IIR filter. Lowpass, Highpass, Bandpass or
Bandstop, respectively.<br>
        <br>
        <b><a name="IIRFilterProc"></a>TdspIIRFilterProc</b> =
function(V: TdspFloat): TdspFloat of object<br>
The filter procedure.</p>
        <p class="dsptext"> <b><a name="TdspFFTPower"></a>TdspFFTPower</b>
= 2..15<br>
The power of 2. Uses in FFT.</p>
        <p class="dsptext"><a name="TdspWindow"></a><b>TdspWindow</b> =
(fwNone, fwHamming, fwHanning, fwBlackman, fwGaussian, fwWelch,
fwParzen)<br>
The window function.<br>
        </p>
        <p class="dsptext"><b><a name="dspFloat"></a>TdspFloat </b>=
Extended</p>
        <p class="dsptext"><b>TdspFloatArray</b> =
Array[0..High(Integer) div Sizeof(TdspFloat) - 1] of TdspFloat<br>
        <b>PdspFloatArray</b> = ^TdspFloatArray</p>
        <p class="dsptext"><b>TdspSingle</b> = Single;<br>
        <b>PdspSingle</b> = ^TdspSingle;</p>
        <p class="dsptext"><b>TdspSingleArray</b> =
Array[0..High(Integer) div Sizeof(TdspSingle) - 1] of TdspSingle<br>
        <b><a name="PdspSA"></a>PdspSingleArray</b> = ^TdspSingleArray</p>
        <p class="dsptext"><b>TdspIntArray</b> = Array[0..High(Integer)
div Sizeof(Integer)-1] of Integer<br>
        <b>PdspIntArray</b> = ^TdspIntArray </p>
      </blockquote>
      <p class="dspsubtitle"><a name="TdspIIRFilter"></a>TdspIIRFilter</p>
      <blockquote>
        <p class="dsptext"> This component implements an infinite
impulse response digital filter. Lowpass, highpass, bandpass and
bandstop filters, with Butterworth, Bessel or Chebyshev
characteristics, are designed using the bilinear transform.<br>
        </p>
        <p class="dsptext"> <b>property Kind:</b> <a
 href="#IIRFilterKind">TdspIIRFilterKind<br>
        </a>The characteristics of IIR filter. You can design the
filter with Butterworth, Bessel or Chebyshev characteristics.<br>
        <br>
        <b>property Response:</b> <a href="#IIRFilterResponse">TdspIIRFilterResponse</a><br>
The frequency response of the filter. You can design the filter with
Lowpass, Highpass, Bandpass or Bandstop frequency response. <br>
        <br>
        <b>property Order</b>: <a href="#FilterOrder">TdspIIRFilterOrder</a><br>
The order of the filter.<br>
        <br>
        <b>property Frequency1</b>: <a href="#dspFloat">TdspFloat</a><b><br>
property Frequency2</b>: <a href="#dspFloat">TdspFloat</a><br>
The corner (&#8211;3 dB) frequencies. For lowpass and highpass filters, only
Frequency1 is required. For bandpass and bandstop filters, both
Frequency1 (the lower corner frequency) and Frequency2 (the upper
corner frequency) are required. The valid values: 0 &lt; Frequency1
&lt; SampleRate / 2; 0 &lt; Frequency2 &lt; SampleRate / 2; Frequency1
&lt; Frequency2. <br>
        <br>
        <b>property SampleRate</b>: <a href="#dspFloat">TdspFloat</a><br>
The sampling rate of signal.<br>
        <br>
        <b>property Ripple</b>: <a href="#dspFloat">TdspFloat</a><br>
The passband ripple in dB, meaningful for Chebyshev filter only.</p>
        <p class="dsptext"><b>Filter:</b> <a href="#IIRFilterProc">TdspIIRFilterProc</a><br>
Or function Filter(InputValue: <a href="#TdspFloat">TdspFloat</a>): <a
 href="#TdspFloat">TdspFloat</a>;<br>
Processing input value according to filter parameters. The result is
filtered value. Data can be processed in real time. For example, you
can process the audio stream in real time.<br>
        <b>Note</b>: In some cases the filter is astable. This effect
occurs when the value of Alpha1=Frequency1/SampleRate is small (less
then 0.001) or the value of equation (Frequency2 - Frequency1) /
SampleRate (for filters with bandpass and bandstop frequency responses)
is small (&lt;0.01). </p>
        <p class="dsptext"> <b>procedure Reset</b><br>
This procedure clears internal buffers.<br>
        </p>
        <p class="dsptext"> <span style="font-weight: bold;">function&nbsp;&nbsp;&nbsp;
GetFrequencyResponse(Frequency: TdspSingle): TdspSingle</span><br>
This procedure returns a frequency response.</p>
        <p class="dsptext"><b>property ManualReset</b>: Boolean<br>
Set this property to true if you want to change the filter parameters
(frequencies
and filter kind) during data processing. Usually (ManualReset = false)
when
the filter parameters are changed the internal buffers are cleared. So
you
can get some distortions at the processed signal. <br>
        <br>
        <b>property Info</b>: String<br>
This property contains filter information: gain, input and output
coefficients.<br>
        <br>
        <b>property LastError</b>: String<br>
This description of the error.<br>
        </p>
      </blockquote>
      <p class="dspsubtitle"><a name="TdspFFT"></a>TdspFFT</p>
      <blockquote>
        <p class="dsptext"> This component implements a fast fourier
transform and inverse fast fourier transform with single floating point
precision.</p>
        <p class="dsptext"> <b>RealIn, ImagIn</b>: <a href="#PdspSA">PdspSingleArray</a><br>
Input data for FFT.<br>
        <br>
        <b>RealOut, ImagOut</b>: <a href="#PdspSA">PdspSingleArray<br>
        </a>Output data.<br>
        <br>
        <b>procedure Clear</b><br>
This procedure zeros the input and output data.<br>
        <br>
        <b>procedure FFT</b><br>
This procedure does FFT.<br>
        <br>
        <b>procedure IFFT</b><br>
This procedure does inverse FFT.<br>
        <br>
        <b>procedure CalculateMagnitudes</b><br>
This procedure calculates the spectrum of signal.<br>
        <br>
        <b>property BufferSize2</b>: Integer<br>
A half of buffer size.<br>
        <br>
        <b>property Power</b>:<a href="#TdspFFTPower"> TdspFFTPower</a><br>
A power of 2. The buffer size = 2^Power.<br>
        <br>
        <b>property BufferSize</b>: Longint<br>
The buffer size. The value must be a power of 2. <br>
        <br>
        <b>property Window</b>: <a href="#TdspWindow">TdspWindow</a><br>
The window function for input data. </p>
      </blockquote>
      <p class="dspsubtitle"><a name="Samples"></a>Examples</p>
      <blockquote>
        <p class="dsptext"> <a href="ScreenShorts/FFT.gif">Simple FFT
demo - Using FFT to get spectrum of signal<br>
        </a>This demo shows how to work with FFT component. The program
generates the signal and fills the FFT buffer with the data. Then the
program calculates FFT and spectrum of signal. And finally, it displays
the input signal and spectrum using TChart component.<br>
        <br>
        <a href="ScreenShorts/IIR.gif">Simple IIR Filter demo - Setup
IIR filter and filtering the signal in real time<br>
        </a>This demo shows how to work with IIR filter component to
process realtime signal. The program generates a signal. The every
value of signal is passed through the filter. The input and output
values are displayed on the screen. Change the parameters of the
filter and you will see the changes of filtered signal on the
chart.</p>
        <p class="dsptext">&nbsp;<a href="ScreenShorts/IIRPlot.jpg">IIR
Plot demo - Plot the frequency response of IIR filter<br>
        </a>This demo shows how to plot the frequency response of IIR
filter. You can change the parameters of filter and plot the frequency
respomse on a chart.<br>
        <br>
        <a href="ScreenShorts/Perfomance.gif">Perfomance - Test the
perfomance of IIR filter and FFT</a><br>
This demo tests perfomance of calculations for IIR filter and FFT on
your system.<br>
        <br>
        <a href="ScreenShorts/Recoder.gif">Simple spectrum analyzer -
Sound visualization during recording<br>
        </a>This demo shows how to calculate the spectrum of recorded
signal in realtime.<br>
        <a href="ScreenShorts/Player.gif"><br>
Simple player - Sound processing and visualization during playing
wav-files</a><br>
This demo shows how to build a timbre block, graphical equalizer and
spectrum analyzer. The timbre block uses IIR Filter components. The
graphical equalizer uses FFT components and FFT convolution method to
filter signal. The spectrum analyzer uses FFT components. Please see
the source code of demos for more details.</p>
      </blockquote>
      <p class="dsptext">&nbsp; </p>
      </td>
    </tr>
    <tr>
      <td colspan="2" class="copyright">Copyright &copy; 2002-2006
Eugen Tarasov</td>
    </tr>
  </tbody>
</table>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -