You are here : matlabSignal Processingsingle

single() - Signal Processing

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.


Syntax

f2 = single(f1) example


Example

Lowpass FIR Filter in Double and Single PrecisionOpen This Example
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)
classe = class(e.Coefficients)

classd =

double


classe =

single


Output / Return Value


Limitations


Alternatives / See Also


Reference