www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/CreateandConfigureComponentsattheSameTimeDSPExample.m
%% Create and Configure Components at the Same Time % This example shows how to create your System object(TM) 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 lowpass filter order and the cutoff frequency of % the |fir1| function. filtLP = dsp.FIRFilter('Numerator',fir1(160,.15)); %% % Create the audio player object and set the sample rate to the same rate % as the input data. audioOut = audioDeviceWriter('SampleRate',audioIn.SampleRate);