%% Lowpass FIR Filter in Double and Single Precision
% Use designfilt to design a 5th-order FIR lowpass filter. Specify a normalized passband frequency of 0.2\pi rad/sample and a normalized stopband frequency of 0.55\pi 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)

% Copyright 2015 The MathWorks, Inc.