f2 = single(f1) casts
coefficients in a digital filter, f1, to single
precision and returns a new digital filter, f2,
that contains these coefficients. This is the only way that you can
create single-precision digitalFilter objects.
Use designfilt to design a 5th-order FIR lowpass filter. Specify a normalized passband frequency of rad/sample and a normalized stopband frequency of rad/sample. Cast the filter coefficients to single precision.
format long
d = designfilt('lowpassfir','FilterOrder',5, ...'PassbandFrequency',0.2,'StopbandFrequency', 0.55);
e = single(d);
classd = class(d.Coefficients)
Digital filter, specified as a digitalFilter object. Use designfilt to generate f1 based
on frequency-response specifications.
Example: d = designfilt('lowpassiir','FilterOrder',3,'HalfPowerFrequency',0.5) specifies
a third-order Butterworth filter with normalized
3-dB frequency 0.5π rad/sample.