Problem with radians and degrees
4 ビュー (過去 30 日間)
古いコメントを表示
I am implementing this code. And the result does not match at all. The result must be in radians and the result must be the following:
sigma (1) = -0.247
omega (1) = 0.966
sigma (2) = -0.494
omega (2) = 0 ~ very small number almost zero
sigma (3) = -0.247
omega (3) = -0.966
I found this on the calculator (in radians). But the program doesn’t match at all
% Chebshevy Poles
clc
clear
n = 3; % filter order
ripple = 1; % dB
epsilon = sqrt(10^(0.1*ripple)-1)
a = (1/n)*asinh(1/epsilon)
for k = 1:1:n
sigma(k) = -sinh(a)*sin(((2*k-1)/2*n)*pi);
omega(k) = cosh(a)*cos(((2*k-1)/2*n)*pi);
end
The value of this a is 0.476
0 件のコメント
採用された回答
the cyclist
2021 年 4 月 29 日
You need parentheses around 2*n. Otherwise, MATLAB will divide by 2, then multiply by n.
% Chebshevy Poles
clc
clear
n = 3; % filter order
ripple = 1; % dB
epsilon = sqrt(10^(0.1*ripple)-1);
a = (1/n)*asinh(1/epsilon);
for k = 1:1:n
sigmak(k) = -sinh(a)*sin(((2*k-1)/(2*n))*pi);
omegak(k) = cosh(a)*cos(((2*k-1)/(2*n))*pi);
end
disp(sigmak)
disp(omegak)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!