Display Component Property Values
To display the current property values for an object, type that object’s handle name at the
command line (such as audioIn). To display the value of a specific property, type
objecthandle.propertyname (such as audioIn.FileName).
Configure Component Property Values
This section shows how to configure the components for your system by setting the
component objects’ properties.
Use this procedure if you have created your components separately from configuring
them. You can also create and configure your components at the same time, as described
in a later example.
For the file reader object, specify the file to read and set the output data type.
For the filter object, specify the filter numerator coefficients using the fir1 function, which
specifies the low pass filter order and the cutoff frequency.
For the audio device writer object, specify the sample rate. In this case, use the same
sample rate as the input data.
audioIn.Filename = "speech_dft_8kHz.wav";
audioIn.OutputDataType = "single";
filtLP.Numerator = fir1(160,.15);
audioOut.SampleRate = audioIn.SampleRate;
Create and Configure Components at the Same Time
This example shows how to create your System object components and configure the
desired properties at the same time. Specify each property with a 'Name', Value argument
pair.
Create the file reader object, specify the file to read, and set the output data type.
audioIn = dsp.AudioFileReader("speech_dft_8kHz.wav",...
'OutputDataType',"single");
Create the filter object and specify the filter numerator using the fir1 function. Specify
the low pass filter order and the cutoff frequency of the fir1 function.
filtLP = dsp.FIRFilter('Numerator',fir1(160,.15));
System Design in MATLAB Using System Objects