Form vectors from a list of TMarkList's.
Spectrogram expects a TSpectrumAnalyzer or descendant to be connected to its Input property. Each time the Pull method is called on component, the connected components are recalcuated and new spectrum is added to the list of spectrums within the component. There are various support routines avialable to help manage that data. Typical usage scenarios are like this (assuming single channel file):
SignalRead.FileName := YourFile;
SignalRead.OpenFile;
SignalRead.RecordTimePosition := StartingTime;
SpectrumAnalyzer.Input := SignalRead;
Spectrogram.Input := SpectrumAnalyzer;
Spectrogram.PullUntilEnd;//process entire file
Spectrogram.SpectralTimeOffset := StartingTime;
Spectrogram.SpectralSamplingFrequency := 1/SignalRead.FramesPerSecond;
Alternative:
SignalRead.FileName := YourFile;
SignalRead.OpenFile;
SignalRead.RecordTimePosition := StartingTime;
SpectrumAnalyzer.Input := SignalRead;
SpectrumAnalyzer.Peaks.TraceMethod := ptAmpltHarmonics;
Spectrogram.TraceOnly := true;
Spectrogram.Input := SpectrumAnalyzer;
Spectrogram.PullUntilEnd;//process entire file
Spectrogram.Trace.EndTrace;
Spectrogram.Trace.SpectralTimeOffset := StartingTime;
Spectrogram.Trace.SpectralSamplingFrequency := 1/SignalRead.FramesPerSecond;
// Spectrogram.Trace[i].Freq //TVec contains gathered data
// Spectrogram.Trace[i].Amplt //TVec contains gathered data
| Name | Type | Description |
|---|
| Active | bool | Set active to false to suppress the propagation of the Pull request and the subsequent call to the Update method. |
| Amplt | TVec* | Stores the amplitude of the spectrum. |
| Averages | int | Used to store the number of averages made. |
| Bands | TSpectrumBandsAnalyzer* | Holds the parameters for the frequency bands. |
| BandWidth | double | Returns the bandwidth of the spectrum in [Hz]. |
| BandwidthH | double | Returns the upper bandwidth edge of the signal. |
| BandwidthL | double | Returns the lower bandwidth edge of the signal. |
| BlockAssign | bool | Block streaming of specific properties when storing only a "template". |
| Complex | bool | Set this property to true, to request computation using complex numbers. |
| ConjExtend | bool | If True, the conjugate symmetric part of the frequency spectrum is to be computed. |
| ConjFlip | bool | If True, the conjugate symmetric part of the frequency spectrum will be placed in 0.5..1.0 Fs (as returned by the FFT), and not between -0.5..0.0 Fs. |
| Continuous | bool | If True, the component will pass on the udpate request to the connected component. |
| Count | int | Specifies the number of the spectrums in the list. |
| Descriptor | TSpectrumDescriptor* | |
| Dt | double | Returns the distance in seconds between two consecutive samples of the signal on which the frequency spectrum is based. |
| EditorActive | bool | Returns True, if the component editor is displayed. |
| FloatPrecision | TMtxFloatPrecision | Set this property to request computation in 32bit/64bit precision with real/complex numbers. |
| FloatPrecisionLock | bool | Set this property to true to lock changes to FloatPrecision property. |
| Harmonics | int | Defines number of harmonics to be used when calculating statistical parameters from the amplitude spectrum. |
| HzRes | double | Returns the frequency resolution in Hz. |
| Input | TSpectrum* | Specifies Input for the data to the component. |
| Inputs | TSignalCollection* | |
| IsDouble | bool | Set this property to false, to request computation in 32bit floating point precision, 64bit, if true. |
| IsSpectrumAnalyzer | bool | Returns true, if the descendant class is derived from TSpectrumAnalyzer. |
| ItemNumber | int | Number to label the object when it is an item in the List. |
| Length | int | Defines the length of the spectrum. |
| Logarithmic | bool | If true, the stored spectrums will be converted to Logarithmic scale. |
| LogSpan | TLogSpan | Defines the span of the logarithmic spectrum in dB. |
| MainlobeWidth | int | Defines the width of the main lobe. Each frequency component in the frequency spectrum should theoretically be infinitely thin. |
| Marks | TMarkList* | Stores the frequency, amplitude and phase of selected frequency bins. |
| MaxAmplt | double | Stores the maximum value of the Amplt spectrum found by the MinMaxAmplt method. |
| MaxFreqIndex | int | Holds the index at which the maximum amplitude was found by the MinMaxAmplt method. |
| MaxPhase | double | Stores the maximum value of the Phase spectrum found by the MinMaxPhase method. |
| MaxSpectrumCount | int | Maximum number of spectrums up to which the spectrogram will grow. |
| MinAmplt | double | Stores the minimum value of the Amplt spectrum found by the MinMaxAmplt method. |
| MinPhase | double | Stores the minimum value of the Phase spectrum found by the MinMaxPhase method. |
| MultiChannel | bool | Set MultiChannel to True, if Inputs property will be published, and Input property will remain hidden. |
| Name | DewString | |
| NarrowBandH | double | Specify value other than 0 to indicate the final frequency of the reduce bandwidth. |
| NarrowBandL | double | Specify value other than 0 to indicate the start of the reduced bandwidth. |
| OnAfterUpdate | tNotifyEvent | The event is triggered after the call to the Update method. |
| OnBandsUpdate | tNotifyEvent | If assigned, this event will be called instead of a call to Bands.Update method. |
| OnBeforeUpdate | tNotifyEvent | The event is triggered just before the call to the Update method. |
| OnDisplayUpdate | tNotifyEvent | The event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables. |
| OnGetInput | tNotifyEvent | If the Input property is not assigned, the component will call OnGetInput. |
| OnNotifyUpdate | tNotifyEvent | The event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method. |
| OnParameterUpdate | tNotifyEvent | The event is triggered when ParamUpdate method is called. The ParamUpdate method is usually called by component editors when a value was changed by the user and the editor was "Live". |
| OnPeaksUpdate | tNotifyEvent | If assigned, this event will be called instead of a call to Peaks.Update method. |
| Peaks | TSpectrumPeaksAnalyzer* | Pointer to the component that manages peak analysis. |
| Phase | TVec* | Stores the phase of the spectrum. |
| PhaseMode | TPhaseMode | This property determines how to handle the phase of the frequency spectrum. |
| PhaseRange | TPhaseRange | Specify the range of the phase spectrum. |
| PhaseUnits | TPhaseUnits | Defines the units of phase. (radian, degrees). |
| PipeDirty | bool | |
| PipeState | TPipeState | Returns the state of the pipe after the last update. |
| Reference | TReferenceList* | Stores a list of components that have to be notified, when this component is destroyed. |
| Report | TSpectrumReport* | Holds the parameters needed to generate a spectrum analysis report. Requires that the descriptor property is properly filled up. |
| SamplingFrequency | double | Defines the sampling frequency of the signal on which the frequency spectrum is based. |
| SamplingTime | double | Defines the length of the signal on which the frequency spectrum is based in seconds. |
| SpectralDt | double | Time in seconds between consecutive spectrums. |
| SpectralSamplingFrequency | double | Sampling frequency with which the spectrums are being sampled. When setting this property Dt is automatically updated. |
| SpectralSamplingTime | double | Total length in seconds between the first and the last spectrum. |
| SpectralTimeOffset | double | Time in seconds at which the spectrogram starts. |
| SuspendNotifyUpdate | bool | Set this property to True, to prevent calling OnNotifyUpdate from the Update Method. |
| Trace | TTraceList* | Containes parameters and results for individual traces. |
| TraceOnly | bool | Specifies to track only marked peaks without entire spectrums. |
| UsesInputs | bool | Set it to True to indicate, that valid signals will be connected to the Input or Inputs properties. |
| ZeroPadding | int | Defines the level of zero padding of the source signal. |
| Name | Description |
|---|
| Add | Add amplitude and phase of the ASpectrum to the current spectrum. |
| AllowStreaming | Returns the negatated value of BlockAssign. |
| AmpltEst (4) | Return amplitude at frequency Freq. |
| AmpltSpectrum | Compute amplitude spectrum from X. |
| Assign | |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| BandFlip | Flip the frequency spectrum on the frequency axis. |
| ConvergeToMaximum (2) | Searches for the closest peaks of the amplitude spectrum. |
| Copy | Copy ASpectrum to the calling spectrum. |
| CopyAmplt | Copies all amplitude spectrums as rows to the destination matrix. |
| CopyAmpltTransposed (2) | Copies all amplitude spectrums as columns to the destination matrix. |
| CopyPhase | Copies all phase spectrums as rows to the destination matrix. |
| Delete | Delete the spectrum at index i. |
| DetectChannelCount | |
| Differentiate | Differentiate the underlying signal in the frequency domain by scaling each amplitude line with a power of its angular frequency. |
| Divide | Divide the calling the spectrum with ASpectrum. |
| EditorClass | To be overriden in descendanr classses. |
| FetchTraces | Copies marked values from spectrogram to the Trace property. |
| FilterPeak | Filter the peak at Marks position Index from the signal and recalculate the spectrum. |
| FreqToFreqIndex | Computes range checked array indexes in the spectrum from frequency values. |
| GetInput | |
| GetInputs | |
| GetSpectrum | |
| InputsDirty | If all Inputs[i] are dirty the function returns true. |
| Insert | Insert spectrum at index. |
| Integrate | Integrate the underlying signal in the frequency domain by dividing each amplitude line by a power of its angular frequency, restoring the DC term afterwards. |
| InternalPull | When called, the method will pass Update requests recursively to all connected objects. |
| Invalidate | Notifies all connected components that this component has fresh data. |
| IsNumericalInterpolationSupported | |
| LoadFromStream | Load the component from Src stream. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| LogAmplt | Compute the logarithm of the amplitude spectrum and convert to dB. |
| MarksToStrings | Convert marks to strings. |
| MinMax | Calls MinMaxAmplt and MinMaxPhase. |
| MinMaxAmplt | Find minimum and maximum value of the Amplt spectrum. |
| MinMaxPhase | Find minimum and maximum value of the Phase spectrum. |
| Move | Move spectrum from SrcIdx to DstIdx index. |
| Mul | Multiply the calling the spectrum with ASpectrum. |
| NF | Noise floor in dB: the mean absolute noise line (lines outside the mark guard bands), relative to the largest marked peak. |
| ParamUpdate | The method can be assigned to some other component even handler, as a notification that a parameter has changed and that Self should consider a recalculation. |
| PeakApproximate | Return the peak closest to the Freq frequency. |
| PhaseEst (4) | Return phase at frequency Freq. |
| PhaseSpectrum | Compute phase spectrum from X. |
| PipeReset | Recursively processes all connected components backward and calls Reset method. |
| PowerSpectrum | Compute power spectrum from X. |
| Pull | Request recalculation of the entire chain of all connected components. |
| PullUntilEnd | Calls Pull until pipeEnd is returned. |
| ReferenceRemoved | |
| Reset | Reset the spectrogram and delete the stored data. |
| RMS | Root-mean-square value reconstructed from the amplitude spectrum. |
| RMSSpectrum | Compute RMS spectrum from X. |
| Rotate | Rotate spectrums down or up in the list. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component to Dst stream. |
| Scale | Scale the calling spectrum with Factor. |
| SetComplex | |
| SetFloatPrecision | |
| SetInputs | |
| SetIsDouble | |
| SetSpectrum | |
| SetZero | Initialize spectrum to zero. |
| SFDR | Spurious-free dynamic range in dB: the ratio of the largest marked peak to the second-largest marked peak. |
| SINAD | Signal-to-noise-and-distortion ratio in dB. Compares the largest marked peak against the noise floor plus every other marked peak. |
| Size | Assign Length, Complex and SamplingFrequency properties. |
| SNR | Signal-to-noise ratio in dB. Sums the absolute amplitudes of all marked peaks and compares against the sum of the absolute amplitude lines outside the mark guard bands. |
| Spectrum | |
| Sqr | Square the Amplt and Phase of the ASpectrum and copy it to self. |
| Subtract | Subtract ASpectrum from the calling spectrum. |
| THD | Total harmonic distortion in percent. Returns the RMS of the marked harmonic peaks (all marks after the first, when sorted by frequency, up to Harmonics) relative to the first (fundamental) marked peak. |
| THDN | Total harmonic distortion plus noise, in percent. Combines the noise floor power with the power of every marked peak except the largest, relative to the largest marked peak. |
| Update | Request recalculation of the data and place the result in Self. |
| UpdateAllTraces | Updates marks for all spectrums then calls FetchTraces. |
| UpdateNotify | Call this method only, if SuspendNotifyUpdate is True. |
| UpdateTraceParameters | Propagates settings of Peaks and Bands properties to all spectrums. |
| ValuesToStrings | Convert values to strings. |