現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How to create Trignometric function lookup table
2 ビュー (過去 30 日間)
古いコメントを表示
Hi
I need help to create a lookup table for twiddle factor generated by trignometric cosine and sine function ?
Thanks
12 件のコメント
Life is Wonderful
2021 年 4 月 16 日
編集済み: Life is Wonderful
2021 年 4 月 19 日
Thank you !
I was looking something like below code .
- Can you pls add further to improve say 1/4 quater radian lookup table and calculate all angles / radians ?
- What is best and efficient way for generating the lookup to get twiddle factor real and imaginary points ?
- How fft and ifft calculation can be improved here in case I use cordic sine and cosine lookup table ?
- cordiccosine and cordicsine Lookup table for N point FFT length ( say 1024,2048 upto 8192) ?
% Angle_rad = [-2*pi:1:2*pi];
close all;
clearvars;clc;
Angle_th = [0:1:360]; %
lookup_table = cos(Angle_th*2*pi/360); % replace cos with
% Replace current code here with pseudo
% What is the size of lookup table ? FFT length -1 , N = 1024, N*m-1 ( m
% =2,3,4 etc )
% cdcCosineTh = cordiccos(th_Rad_fix = [-2*pi :steps: 2*pi]);
% cdcsinTh = cordicsin(th_Rad_fix = [-2*pi :steps: 2*pi]);
% lookup_table[sizeof(FFT_Index)] = cordiccos(th_Rad_fix = [-2*pi :steps: 2*pi]) + -j*cordicsin(th_Rad_fix = [-2*pi :steps: 2*pi]);
% Which Radix 2/4/8/16/64/128/256 for odd and even is suggested and why ?
% How real and imaginary lookup table looks like
% Input real_lookup_cordiccos(angles[0:360])
% Input imag_lookup_cordicsin(angles[0:360])
% Accuracy ,performat and speed are determined by total harmonic
% distortion in -dBc i.e. SNR = rms( cordiccos & cordicsin -
% lookup_table_real & lookup_table_imag)
% It should work for iFFT and FFT implementation (reconstruct) without dC
% and capture fundamental and all harmonics for 2 octave onwards
% clf;
figure;
subplot(3,2,1);
plot(1:size(Angle_th,2),cos(Angle_th*2*pi/360),'g--','Linewidth', 1.5); hold on; grid on;
xlabel('\theta');
h1.XLim = [0, 2*pi];
h1.XTick =[0:22.5:360];
h1.XTickLabel = {'0', '45', '90','135' , '180' , '225' , '270' , '315' , '360'};
h1.YTick = -1:0.5:1;
h1.YTickLabel = {'-1.0','-0.5','0','0.5','1.0'};
title('Trignometric-Cosine-Lookup-table');
subplot(3,2,2);
plot(1:size(Angle_th,2),sin(Angle_th*2*pi/360),'r--','Linewidth', 1.5); hold on; grid on;
xlabel('\theta');
h1.XLim = [0, 2*pi];
h1.XTick =[0:22.5:360];
h1.XTickLabel = {'0', '45', '90','135' , '180' , '225' , '270' , '315' , '360'};
h1.YTick = -1:0.5:1;
h1.YTickLabel = {'-1.0','-0.5','0','0.5','1.0'};
title('Trignometric-sine-Lookup-table');
subplot(3,2,3);
radian = (pi/180)*Angle_th;
plot(Angle_th,radian,'r--'); hold on; grid on;
xlabel('\theta');ylabel('Radian');
subplot(3,2,4);
radian = (pi/180)*Angle_th;
plot(Angle_th,cos(radian),'r--'); hold on; grid on;
xlabel('\theta');ylabel('ARC');
subplot(3,2,5);
degree = (180/pi)*radian;
plot(radian,(degree),'b--'); hold on; grid on;
h1.YLim = [0, 360];
h1.YTick =[0:22.5:360];
h1.YTickLabel = {'0', '45', '90','135' , '180' , '225' , '270' , '315' , '360'};
ylabel('\theta');xlabel('Radian');
subplot(3,2,6);
degree = (180/pi)*radian;
plot(radian,cos(degree),'b--'); hold on; grid on;
ylabel('\theta');xlabel('Arc');
Walter Roberson
2021 年 4 月 16 日
You do not seem to be using the Fixed Point Toolbox, but you seem to be wanting to implement fixed point operations ?
Life is Wonderful
2021 年 4 月 16 日
That's right Walter. Initial preparation is done for floating point and next level take it to DSP :-)
The reason is to know the total harmonic distortion across the fltpt and fixpt
Walter Roberson
2021 年 4 月 16 日
Write it using the fixed point toolbox. One of the options for fixed point toolbox use is to override the fixed point definitions with double precision for testing purposes. And you can test in fixed point on the host CPU anyhow.
Life is Wonderful
2021 年 4 月 16 日
編集済み: Life is Wonderful
2021 年 4 月 16 日
@Walter Roberson, can you please help me with some references for twiddle calculation using cordic cosine and cordic sine function?
I am assuming for calculation
twiddle(index) = cos(theta) + (1i*(sin(theta)));
Thank you!
Walter Roberson
2021 年 4 月 19 日
I do not know about twiddle calculation for cordic, so I would have to research it.
Walter Roberson
2021 年 4 月 19 日
Walter Roberson
2021 年 4 月 19 日
You asked for references about twiddle factor computation; I linked to a reference about twiddle factor computation.
If you had asked for a MATLAB implementation then I probably would not have posted any links. I do not have source code for that purpose, and I do not have time to research the topic and write the code.
Life is Wonderful
2021 年 4 月 20 日
編集済み: Life is Wonderful
2021 年 4 月 20 日
I have some insight now . Folks have worked on this topic and there are advantage of using cordic algorithm for twiddle factor on DSP. May be MathWork documentation is poor and they should come up
With this I can write equation on a paper and start designing the code.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Debugging and Analysis についてさらに検索
タグ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)