TSignalRead Class

Header: Dew.Signal/FileSignal.h · Cross-compiler
tObjectTMtxComponentTAnalysisTSignalTFileStorageTSignalRead

class TSignalRead : public TFileStorage;

Reads a signal from the file.

TSignalRead is probably the most important component to understand in order to make effective use of other signal processing components.

Use TSignalRead to read wav, binary and text files and provide streaming capabilities with frame navigation and overlapp support. The read data is placed in the Data property and its sample count is determined with the Length property. Once a file is opened, the key properties immediatelly contain all the necessary information about the file size, number of records, data type etc...

You can connect the component to other components which have an Input property. Example: SpectrumAnalyzer.Input = SignalRead; By calling SpectrumAnalyzer.Pull data will be read from the file and a frequency spectrum will be computed.

Constructors

NameDescription
TSignalRead (2)

Destructors

NameDescription
~TSignalRead

Properties

NameTypeDescription
ActiveboolSet active to false to suppress the propagation of the Pull request and the subsequent call to the Update method.
AutoFileFormatboolIf True, the file format will be automatically determined from the file name extension.
BandWidthdoubleReturn the bandwidth of the signal.
BandwidthHdoubleReturns the upper bandwidth edge of the signal.
BandwidthLdoubleReturns the lower bandwidth edge of the signal.
BlockAssignboolBlock streaming of specific properties when storing only a "template".
ChannelCountintGet or set the number of channels multiplexed in the data property.
ComplexboolSet this property to true, to request computation using complex numbers.
ContinuousboolIf True, the component will pass on the udpate request to the connected component.
DataTVec*Stores the result of the processing.
DtdoubleTime between two consecutive samples.
EditorActiveboolReturns True, if the component editor is displayed.
FileFormatTFileFormatDefines the format of the file, if AutoFileFormat property is False.
FileNameDewStringDefines the file name to be read from or written to.
FloatPrecisionTMtxFloatPrecisionSet this property to request computation in 32bit/64bit precision with real/complex numbers.
FloatPrecisionLockboolSet this property to true to lock changes to FloatPrecision property.
ForceLengthboolWarn about compressed files varying Length read.
FrameNumberlong longSet FrameNumber to position the read cursor within the current record.
FramesPerSeconddoubleReturns the number of frames per second according to Framing and overlapp properties.
FramingTFramingDefines the method to traverse a multi-record the file.
HzResdoubleFrequency resolution obtained, if an FFT algorithm would be run on the data.
InputTSignal*
InputsTSignalCollection*
IsDoubleboolSet this property to false, to request computation in 32bit floating point precision, 64bit, if true.
ItemNumberintNumber to label the object when it is an item in the List.
LastFrameCheckTLastFrameCheckSpecifies how to handle the end of file.
LengthintGet or set the length of the signal in samples.
LoopboolIf true, looping will be enabled.
MarksTMarkList*Stores the time stamps and amplitude of selected samples.
MaxAmpltdoubleStores the maximum amplitude of the signal found by the MinMax method.
MaxFrameslong longRead Only. Determine the maximum number of frames.
MaxXdoubleUse the MaxX property to store the time stamp (in seconds) of the right most sample.
MinAmpltdoubleStores the minimum amplitude of the signal found by the MinMax method.
MinXdoubleUse the MinX property to store the time stamp of the left-most sample.
MultiChannelboolSet MultiChannel to True, if Inputs property will be published, and Input property will remain hidden.
NameDewString
NumberOfRecordsintRead only. Returns the number of records contained in the current file.
OnAfterUpdatetNotifyEventThe event is triggered after the call to the Update method.
OnBeforeUpdatetNotifyEventThe event is triggered just before the call to the Update method.
OnDisplayUpdatetNotifyEventThe event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables.
OnGetInputtNotifyEventIf the Input property is not assigned, the component will call OnGetInput.
OnNotifyUpdatetNotifyEventThe event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method.
OnParameterUpdatetNotifyEventThe 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".
OnProcessAlltNotifyEventEvent triggered when Process command is selected from the drop-down menu in the component editor.
OnRecordPositionChangetNotifyEventTriggered after RecordPosition changes.
OverlappingPercentdoubleDefine the overlapping in percent of consequtive frames when reading the file.
OverlappingSamplesintDefine the overlapping in sampels of consequtive frames when reading the file.
PipeDirtybool
PipeStateTPipeStateReturns the state of the pipe after the last update.
PostBufferSamplesintAppend zeros to then end of file.
PostBufferTimedoubleAppend zeros to end of file.
PrecisionTPrecisionRead the precision of the data being read from the file.
RecordLengthlong longRead only. Returns the length of the current record in samples for one channel.
RecordNumberintSet RecordNumber to move the read cursor within the file to the record with RecordNumber number.
RecordPositionlong longSet and get position in samples.
RecordTimedoubleRead only. Returns the length of the current record in seconds for one channel.
RecordTimePositiondoubleSet RecordTimePosition in seconds to position the read cursor within the current record.
ReferenceTReferenceList*Stores a list of components that have to be notified, when this component is destroyed.
SamplingFrequencydoubleDefines the sampling frequency of the signal.
SamplingTimedoubleThe length of the signal in seconds.
ScaleFactordoubleDefines a scale factor to be applied to just read data.
SelectionStartlong longSpecifies the lower file range limit.
SelectionStoplong longSpecifies the upper file range limit.
SuspendNotifyUpdateboolSet this property to True, to prevent calling OnNotifyUpdate from the Update Method.
UsesInputsboolSet it to True to indicate, that valid signals will be connected to the Input or Inputs properties.

Methods

NameDescription
AllowStreaming
AppendAppends Sample to the end of the signal.
Assign
AssignTemplateAssign values of "template-like" published properties from Source.
CloseFileClose file.
CopyCopies signal Data and sampling frequency information.
CrestCompute the CREST parameter.
DetectChannelCount
EditorClass
FileIsOpenReturns true, if the file is open.
FileSizeReturns the size of the file in bytes.
FirstFrameSets the record position to the start of the current record and reads the data.
FormatDescriptionReturns the description of the file format.
FormatTagDescriptionReturns the name of the file format.
get_CValues
get_Values
GetInput
GetInputs
InputsDirtyIf all Inputs[i] are dirty the function returns true.
InternalPull
InvalidateNotifies all connected components that this component has fresh data.
IsEndOfFileReturns true, if the current frame is the last frame.
LastFrameSets the record position to the start of the last frame of the current record and reads the data.
LoadFromStreamLoad the component from Src stream.
LoadHeaderFileReads the header file for raw file formats.
LoadTemplateFromFileLoad a template from file.
LoadTemplateFromStreamLoad a template from stream.
MarksToStringsConvert marks to strings.
MinMaxFind minimum and maximum amplitude and store the result in the MinAmplt and MaxAmplt properties.
NextFrameAdvances the record position forward in the current record and reads the data.
OpenFileOpen file.
ParamUpdateThe 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.
PeakFind the maximum deviation of the signal from its mean value.
PipeResetRecursively processes all connected components backward and calls Reset method.
PrevFrameMoves the record position backward in the current record and reads the data.
PullRequest recalculation of the entire chain of all connected components.
PullUntilEndCalls Pull until pipeEnd is returned.
RawFileFormatChecks if the file format is raw.
ReferenceRemoved
Reset
SamplesLeftReturnes the number of samples left to the end of the file per channel.
SaveHeaderFileSaves a header file describing file contents.
SaveTemplateToFileSave template to file.
SaveTemplateToStreamSave template to stream.
SaveToStreamSave the component to Dst stream.
set_CValues
set_Values
SetComplex
SetFloatPrecision
SetInputs
SetIsDouble
SetSamplingFrequency
SizeAssign the size of the signal from Src.
UpdateRequest recalculation of the data and place the result in Self.
UpdateNotifyCall this method only, if SuspendNotifyUpdate is True.
Values
ValuesToStringsConvert values to strings.

Operators

NameDescription
operator[]

Fields

NameTypeDescription
Tagintptr_t