このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
cordictanh
CORDIC ベースの双曲線正接
説明
例
CORDIC 双曲線正接の計算
既定の反復回数で CORDIC の実装を使用して fi
オブジェクト theta
の双曲線正接を求めます。
theta = fi(-2*pi:.1:2*pi-.1); T_cordic = cordictanh(theta);
関数 tanh
とその CORDIC 近似を使用して theta
の双曲線正接をプロットします。
T = tanh(double(theta)); plot(theta, T_cordic); hold on; plot(theta, T); legend('CORDIC approximation of tanh', 'tanh'); xlabel('theta'); ylabel('tanh(theta)');
関数 cordictanh
と関数 tanh
の結果の差分を計算します。
figure; err = abs(T - double(T_cordic)); plot(theta, err); xlabel('theta'); ylabel('error');
指定した反復回数による CORDIC 双曲線正接の計算
CORDIC 実装を使用して fi
オブジェクト theta
の双曲線正接を求め、CORDIC カーネルで実行すべき反復回数を指定します。さまざまな反復回数で theta の双曲線正接の CORDIC 近似をプロットします。
theta = fi(-2*pi:.1:2*pi-.1); for niters = 5:10:25 T_cordic = cordictanh(theta,niters); plot(theta,T_cordic); hold on; end xlabel('theta'); ylabel('tanh(theta)'); legend('5 iterations','15 iterations',... '25 iterations','Location','southeast');
入力引数
theta
— 角度の値
スカラー | ベクトル | 行列 | n 次元配列
ラジアン単位の角度の値。スカラー、ベクトル、行列または多次元配列として指定します。
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
niters
— 反復回数
スカラー
CORDIC アルゴリズムを実行する反復回数。正の整数値スカラーとして指定します。niters
を指定しない場合、アルゴリズムは既定値を使用します。固定小数点の入力では、niters
の既定値は入力配列 theta
の語長よりも 1 つ少なくなります。倍精度の入力では、niters
の既定値は 52 です。単精度の入力では、既定値は 23 です。
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
出力引数
T
— 出力配列
スカラー | ベクトル | 行列 | n 次元配列
T
は theta
の双曲線正接の CORDIC ベースの近似です。関数への入力が浮動小数点である場合、出力のデータ型は入力のデータ型と同じです。入力が固定小数点である場合、出力の語長は入力の語長と等しく、小数部の長さは WordLength
– 2
と等しくなります。
拡張機能
HDL コード生成
HDL Coder™ を使用して FPGA 設計および ASIC 設計のための VHDL、Verilog および SystemVerilog のコードを生成します。
関数 cordictanh
は、MATLAB® からの SystemC™ コード生成もサポートしています。
バージョン履歴
R2017b で導入
参考
cordicatan2
| cordicsin
| cordiccos
| tanh
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)