fixpt_look1_func_approx
ルックアップ テーブルのデータ点を内挿することによって、非線形関数の固定小数点近似を最適化
構文
[xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,errmax,nptsmax)
[xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,errmax,[])
[xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,[],nptsmax)
[xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydtydt,yscale,rndmeth,errmax,nptsmax,spacing)
説明
[ は、ルックアップ テーブルの最適ブレークポイント、ブレークポイントに適用された理想関数、最悪の近似誤差を返します。ルックアップ テーブルは、指定された最大許容誤差と点数の最大数を満たします。xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,errmax,nptsmax)
[ は、ルックアップ テーブルの最適ブレークポイント、ブレークポイントに適用された理想関数、最悪の近似誤差を返します。ルックアップ テーブルは、指定された最大許容誤差を満たします。xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,errmax,[])
[ は、ルックアップ テーブルの最適ブレークポイント、ブレークポイントに適用された理想関数、最悪の近似誤差を返します。ルックアップ テーブルは、指定された点数の最大値を満たします。xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,[],nptsmax)
[ は、ルックアップ テーブルの最適ブレークポイント、ブレークポイントに適用された理想関数、最悪の近似誤差を返します。ルックアップ テーブルは、指定された最大許容誤差、点数の最大数、ブレークポイント間隔を満たします。xdata,ydata,errworst] = fixpt_look1_func_approx('func',...
xmin,xmax,xdt,xscale,ydtydt,yscale,rndmeth,errmax,nptsmax,spacing)
どの場合も、fixpt_look1_func_approx は固定小数点近似が最適化されるように、ルックアップ テーブルのデータ点を内挿します。入力 xmin と xmax はブレークポイントを近似する範囲を指定します。入力 xdt、xscale、ydt、yscale、および rndmeth は固定小数点 Simulink® ブロックの規則に従います。
入力 errmax、nptsmax、および spacing はオプションです。これらの入力のうち、最低 errmax または nptsmax を指定する必要があります。この 2 つのうちの 1 つを省略する場合は、省略された入力の代わりに大かっこ [] を使用する必要があります。fixpt_look1_func_approx はその要件をルックアップ テーブルで無視します。
間隔を指定しないでおくと、errmax と nptsmax を満たす間隔が 1 つを超えてある場合、fixpt_look1_func_approx は 2 のべき乗の間隔、等間隔、不等間隔の順に選択します。この動作は errmax と nptsmax を両方とも指定した場合に適用されますが、どちらか 1 つを指定した場合には適用されません。
入力引数
| ブレークポイントの近似に使用する | ||||||||
|
| ||||||||
|
| ||||||||
|
| ||||||||
|
| ||||||||
|
| ||||||||
|
| ||||||||
| 固定小数点の Simulink ブロックでサポートされる丸め処理モード。
| ||||||||
| 理想関数とルックアップ テーブルから得られた近似値の間の最大許容誤差。 | ||||||||
| ルックアップ テーブルの点数の最大数。 | ||||||||
| ルックアップ テーブルのブレークポイントの間隔。
|
| 指定する項目 | ルックアップ テーブルのブレークポイントが満たす条件 |
|---|---|
| 可能な限り、両方の条件を満たす。
|
| 誤差条件を満たし、 |
| 点数条件を満たし、 |
出力引数
| ルックアップ テーブルのブレークポイントのベクトル。 |
| ブレークポイントに理想関数を適用して得た値のベクトル。 |
| 最悪誤差。理想関数とルックアップ テーブルから得られた近似値の間の最大絶対誤差。 |
例
ルックアップ テーブルを使用して、固定小数点の正弦関数を近似します。
func = 'sin(2*pi*x)'; % Define the range over which to optimize breakpoints xmin = 0; xmax = 0.25; % Define the data type and scaling for the inputs xdt = ufix(16); xscale = 2^-16; % Define the data type and scaling for the outputs ydt = sfix(16); yscale = 2^-14; % Specify the rounding method rndmeth = 'Floor'; % Define the maximum acceptable error errmax = 2^-10; % Choose even, power-of-2 spacing for breakpoints spacing = 'pow2'; % Create the lookup table [xdata,ydata,errworst] = fixpt_look1_func_approx(func,... xmin,xmax,xdt,xscale,ydt,yscale,rndmeth,errmax,[],spacing);
バージョン履歴
R2006a より前に導入
参考
fixpt_evenspace_cleanup | fixpt_look1_func_plot
トピック
- ルックアップ テーブル データの生成 (Fixed-Point Designer)
- ルックアップ テーブルによる近似関数の使用 (Fixed-Point Designer)