フィルターのクリア

Evaluation and plotting a kernel function

2 ビュー (過去 30 日間)
Hamza Khan
Hamza Khan 2022 年 7 月 11 日
回答済み: Chunru 2022 年 7 月 12 日
Trying to evaluate and plot a kernal function. This is the code I currently have. The end goal is to see the effect of this kernal on an audio signal using discrete-time convolution.
%Kernal 1
Fs = 33600
n = 1:1:33600;
a = floor(n-(Fs/2));
c = (1200*pi)/Fs; % c is greek letter chi
g = pi/Fs; % g is greek symbol gamma
k1 = (sin(a*c))/(a*g);
plot(n,k1)

回答 (1 件)

Chunru
Chunru 2022 年 7 月 12 日
%Kernal 1
Fs = 33600
Fs = 33600
n = 1:1:33600;
a = floor(n-(Fs/2));
c = (1200*pi)/Fs; % c is greek letter chi
g = pi/Fs; % g is greek symbol gamma
% To evaluate the function, you need to consider the case where denominitor
% is zero
% Alternatively, you can use sinc function. doc sinc for details
k1 = zeros(size(a));
idx = ~(a==0);
k1(~idx) = c./g;
k1(idx) = (sin(a(idx)*c))./(a(idx)*g); % ./
plot(n,k1)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by