Complete the code to create a lowpass FIR filter block using DSP System Toolbox.
lpFilt = dsp.FIRFilter('Numerator', [1]);
The 'Numerator' property defines the filter coefficients. A simple lowpass FIR filter can be created with equal coefficients summing to 1, like [0.2 0.2 0.2 0.2 0.2].
Complete the code to create a spectrum analyzer block with a sample rate of 1000 Hz.
specAnalyzer = dsp.SpectrumAnalyzer('SampleRate', [1]);
The 'SampleRate' property sets the sample rate for the spectrum analyzer. Here, 1000 Hz is the correct value.
Fix the error in the code to create a decimator block with a decimation factor of 4.
decim = dsp.Decimator('DecimationFactor', [1]);
The 'DecimationFactor' must be set to 4 to correctly decimate the signal by a factor of 4.
Fill both blanks to create a bandpass filter with lower cutoff 100 Hz and upper cutoff 300 Hz.
bpFilt = dsp.BandpassFilter('LowerCutoffFrequency', [1], 'UpperCutoffFrequency', [2]);
The bandpass filter requires the lower cutoff frequency to be 100 Hz and the upper cutoff frequency to be 300 Hz.
Fill all three blanks to create a variable bandwidth filter with center frequency 500 Hz, bandwidth 200 Hz, and sample rate 2000 Hz.
varFilt = dsp.VariableBandwidthFilter('CenterFrequency', [1], 'Bandwidth', [2], 'SampleRate', [3]);
The center frequency is 500 Hz, bandwidth is 200 Hz, and sample rate is 2000 Hz as specified.