double
Cast coefficients of digital filter to double precision
Syntax
Description
Examples
Lowpass FIR Filter in Single and Double Precision
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 to single precision and cast it back to double precision. Display the first coefficient of each filter.
format long d = designfilt('lowpassfir','FilterOrder',5, ... 'PassbandFrequency',0.2,'StopbandFrequency', 0.55); e = single(d); f = double(e); coed = d.Coefficients(1)
coed = 0.003947882145754
coee = e.Coefficients(1)
coee = single
0.0039479
coef = f.Coefficients(1)
coef = 0.003947881981730
Use double
to analyze, in double precision, the effects of single-precision quantization of filter coefficients.
Input Arguments
f1
— Single-precision digital filter
digitalFilter
object
Single-precision digital filter, specified as a digitalFilter
object.
Use designfilt
to generate
a digital filter based on frequency-response specifications and single
to cast it to single precision.
Example: f1= single(designfilt('lowpassfir','FilterOrder',3,'HalfPowerFrequency',0.5))
specifies
a third-order Butterworth filter with normalized 3-dB frequency 0.5π
rad/sample cast in single precision.
Output Arguments
f2
— Double-precision digital filter
digitalFilter
object
Double-precision digital filter, returned as a digitalFilter
object.
Version History
Introduced in R2014a
See Also
designfilt
| digitalFilter
| isdouble
| issingle
| single
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)