Equation for Matlab Code
古いコメントを表示
I have coded a swept sine signal using a for loop, I am aware that the equation would require a sigma for this.
in terms of x(t)=...
Could anyone help with placing this code into a mathmatical equation?
Many thanks
T=5; %size of window
fs=44100; %sampling frequency
df=1/T; %frequency res
dt=1/fs; %time resolution
t=(0:+dt:T-dt); %time vector
df_t=500; %swept rate (Hz/seconds)
% pre-allocate size of t:
sweptsin = zeros(size(t));
for i=1:+1:length(t)
%i=i+1;
if(i==1) %initialise f and t.
f=20; ti=0;
else
ti=ti+dt; %time increment
f=f+df_t*dt; %freq increment
end
w=2*pi*f; %omega
sweptsin(i)=sin(w*ti); %swept sine wave
end
4 件のコメント
Image Analyst
2022 年 5 月 25 日
What do you mean would require a sigma? You're making a sine wave with thousands of periods so that you can't see them unless you zoom way in. Not sure what you want. Do you want a longer period so you can see something more like a typical chirp signal?
David Kendal
2022 年 5 月 26 日
David Kendal
2022 年 5 月 26 日
David Kendal
2022 年 5 月 26 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differentiation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!













