符号付固定小数点の16進数をフーリエ変換する方法を教えてください。
2 views (last 30 days)
Show older comments
下記のような符号付固定小数点の16進数のfiオブジェクトy_fiをフーリエ変換する方法を教えてください。
fs = 1000e3;
Ts = 1/fs;
tsim = 0.001;
n = floor(tsim/Ts);
t = (0:n-1)'*Ts;
y = zeros(n,1);
fin = 1000;
a = 1;
y(1:end) = a*sin(2*pi*fin*t);
T = numerictype(true,64,60);
F = fimath('OverflowMode', 'saturate',...
'RoundMode', 'round',...
'SumMode', 'FullPrecision',...
'ProductMode', 'FullPrecision',...
'MaxProductWordLength', 256,...
'MaxSumWordLength', 256);
y_fi = fi(y,T,F);
Answers (1)
Hernia Baby
on 26 Jul 2022
①について
すみませんが、double型に戻さないでのスペクトル解析はわかりませんでした。
②について
double型でいいのなら1行で解析可能です
fs = 1000e3;
Ts = 1/fs;
tsim = 0.001;
n = floor(tsim/Ts);
t = (0:n-1)'*Ts;
y = zeros(n,1);
fin = 1000;
a = 1;
y(1:end) = a*sin(2*pi*fin*t);
T = numerictype(true,64,60);
F = fimath('OverflowMode', 'saturate',...
'RoundMode', 'round',...
'SumMode', 'FullPrecision',...
'ProductMode', 'FullPrecision',...
'MaxProductWordLength', 256,...
'MaxSumWordLength', 256);
y_fi = fi(y,T,F);
double型にしてパワースペクトル解析を行います
pspectrum(double(y_fi),fs)
See Also
Categories
Find more on 変換 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!