public class TSignalRead : 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.
Examples
SignalRead.FileName = MyFile.wav;
SignalRead.OpenFile;
SignalDemuxList.Input = SignalRead;
SignalDemuxList.Pull;
//now we have demulitplexed data stored in:
//SignalDemuxList[0].Data
//SignalDemuxList[1].Data
//..
//SignalDemuxList[SignalRead.ChannelCount-1].Data
Properties
| Name | Type | Description |
|---|---|---|
| Active | Boolean | Set active to false to suppress the propagation of the Pull request and the subsequent call to the Update method. |
| AutoFileFormat | Boolean | If True, the file format will be automatically determined from the file name extension. |
| BandWidth | Double | Return the bandwidth of the signal. |
| BandwidthH | Double | Returns the upper bandwidth edge of the signal. |
| BandwidthL | Double | Returns the lower bandwidth edge of the signal. |
| BlockAssign | Boolean | Block streaming of specific properties when storing only a "template". |
| ChannelCount | Int32 | Get or set the number of channels multiplexed in the data property. |
| Complex | Boolean | Set this property to true, to request computation using complex numbers. |
| Continuous | Boolean | If True, the component will pass on the udpate request to the connected component. |
| Data | TVec | Stores the result of the processing. |
| Dt | Double | Time between two consecutive samples. |
| EditorActive | Boolean | Returns True, if the component editor is displayed. |
| FileFormat | TFileFormat | Defines the format of the file, if AutoFileFormat property is False. |
| FileName | String | Defines the file name to be read from or written to. |
| FloatPrecision | TMtxFloatPrecision | Set this property to request computation in 32bit/64bit precision with real/complex numbers. |
| FloatPrecisionLock | Boolean | Set this property to true to lock changes to FloatPrecision property. |
| ForceLength | Boolean | Warn about compressed files varying Length read. |
| FrameNumber | Int64 | Set FrameNumber to position the read cursor within the current record. |
| FramesPerSecond | Double | Returns the number of frames per second according to Framing and overlapp properties. |
| Framing | TFraming | Defines the method to traverse a multi-record the file. |
| HzRes | Double | Frequency resolution obtained, if an FFT algorithm would be run on the data. |
| Input | TAnalysis | Connector property to obtain a pointer to the TSignal component holding the data to be processed. |
| IsDouble | Boolean | Set this property to false, to request computation in 32bit floating point precision, 64bit, if true. |
| Item | Double | Default property to access values of a real signal. |
| ItemNumber | Int32 | Number to label the object when it is an item in the List. |
| LastFrameCheck | TLastFrameCheck | Specifies how to handle the end of file. |
| Length | Int32 | Get or set the length of the signal in samples. |
| Loop | Boolean | If true, looping will be enabled. |
| Marks | TMarkList | Stores the time stamps and amplitude of selected samples. |
| MaxAmplt | Double | Stores the maximum amplitude of the signal found by the MinMax method. |
| MaxFrames | Int64 | Read Only. Determine the maximum number of frames. |
| MaxX | Double | Use the MaxX property to store the time stamp (in seconds) of the right most sample. |
| MinAmplt | Double | Stores the minimum amplitude of the signal found by the MinMax method. |
| MinX | Double | Use the MinX property to store the time stamp of the left-most sample. |
| NumberOfRecords | Int32 | Read only. Returns the number of records contained in the current file. |
| OnAfterUpdate | TNotifyEvent | The event is triggered after the call to the 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". |
| OnProcessAll | TNotifyEvent | Event triggered when Process command is selected from the drop-down menu in the component editor. |
| OnRecordPositionChange | TNotifyEvent | Triggered after RecordPosition changes. |
| OverlappingPercent | Double | Define the overlapping in percent of consequtive frames when reading the file. |
| OverlappingSamples | Int32 | Define the overlapping in sampels of consequtive frames when reading the file. |
| PipeState | TPipeState | Returns the state of the pipe after the last update. |
| PostBufferSamples | Int32 | Append zeros to then end of file. |
| PostBufferTime | Double | Append zeros to end of file. |
| Precision | TPrecision | Read the precision of the data being read from the file. |
| RecordLength | Int64 | Read only. Returns the length of the current record in samples for one channel. |
| RecordNumber | Int32 | Set RecordNumber to move the read cursor within the file to the record with RecordNumber number. |
| RecordPosition | Int64 | Set and get position in samples. |
| RecordTime | Double | Read only. Returns the length of the current record in seconds for one channel. |
| RecordTimePosition | Double | Set RecordTimePosition in seconds to position the read cursor within the current record. |
| Reference | TReferenceList | Stores a list of components that have to be notified, when this component is destroyed. |
| SamplingFrequency | Double | Defines the sampling frequency of the signal. |
| SamplingTime | Double | The length of the signal in seconds. |
| ScaleFactor | Double | Defines a scale factor to be applied to just read data. |
| SelectionStart | Int64 | Specifies the lower file range limit. |
| SelectionStop | Int64 | Specifies the upper file range limit. |
| SuspendNotifyUpdate | Boolean | Set this property to True, to prevent calling OnNotifyUpdate from the Update Method. |
| UsesInputs | Boolean | Set it to True to indicate, that valid signals will be connected to the Input or Inputs properties. |
Methods
| Name | Description |
|---|---|
| AllowStreaming | Returns the negatated value of BlockAssign. |
| Append | Appends Sample to the end of the signal. |
| Assign | Assign values of all published properties from Source. |
| AssignTemplate | Assign values of "template-like" published properties from Source. |
| CloseFile | Close file. |
| Copy | Copies signal Data and sampling frequency information. |
| Crest | Compute the CREST parameter. |
| EditorClass | To be overriden in descendanr classses. |
| FileIsOpen | Returns true, if the file is open. |
| FileSize | Returns the size of the file in bytes. |
| FirstFrame | Sets the record position to the start of the current record and reads the data. |
| FormatDescription | Returns the description of the file format. |
| FormatTagDescription | Returns the name of the file format. |
| InputsDirty | If all Inputs[i] are dirty the function returns true. |
| 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. |
| IsEndOfFile | Returns true, if the current frame is the last frame. |
| LastFrame | Sets the record position to the start of the last frame of the current record and reads the data. |
| LoadFromStream | Load the component from Src stream. |
| LoadHeaderFile | Reads the header file for raw file formats. |
| LoadTemplateFromFile | Load a template from file. |
| LoadTemplateFromStream | Load a template from stream. |
| MarksToStrings | Convert marks to strings. |
| MinMax | Find minimum and maximum amplitude and store the result in the MinAmplt and MaxAmplt properties. |
| NextFrame | Advances the record position forward in the current record and reads the data. |
| OpenFile | Open file. |
| 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. |
| Peak | Find the maximum deviation of the signal from its mean value. |
| PipeReset | Recursively processes all connected components backward and calls Reset method. |
| PrevFrame | Moves the record position backward in the current record and reads the data. |
| Pull | Request recalculation of the entire chain of all connected components. |
| PullUntilEnd | Calls Pull until pipeEnd is returned. |
| RawFileFormat | Checks if the file format is raw. |
| Reset | Reset is called after loading the data from stream or file. |
| SamplesLeft | Returnes the number of samples left to the end of the file per channel. |
| SaveHeaderFile | Saves a header file describing file contents. |
| SaveTemplateToFile | Save template to file. |
| SaveTemplateToStream | Save template to stream. |
| SaveToStream | Save the component to Dst stream. |
| Size | Assign the size of the signal from Src. |
| Update | Request recalculation of the data and place the result in Self. |
| UpdateNotify | Call this method only, if SuspendNotifyUpdate is True. |
| ValuesToStrings | Convert values to strings. |
Events
| Name | Description |
|---|---|
| OnAfterUpdateEvent | The event is triggered after the call to the Update method. |
| OnBeforeUpdateEvent | The event is triggered just before the call to the Update method. |
| OnDisplayUpdateEvent | The event is triggered after the OnAfterUpdate event. Use this event to update any associated charts or graphs or result tables. |
| OnGetInputEvent | If the Input property is not assigned, the component will call OnGetInput. |
| OnNotifyUpdateEvent | The event is called after a call to InternalUpdate, OnAfterUpdate and OnDisplayUpdate from within the Update method. |
| OnParameterUpdateEvent | 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". |
| OnProcessAllEvent | Event triggered when Process command is selected from the drop-down menu in the component editor. |
| OnRecordPositionChangeEvent | Triggered after RecordPosition changes. |