周波数が時間的に増加していくプログラムについて
34 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
周波数が時間に対して一時間数的に増加するサイン波のプログラムを作りたいと思っています。
式にすると、X = sin(2πft) で、周波数 f は f [Hz] = 12*t [s]という一次関数をイメージしています。
ここで、スペクトログラムに表れた周波数が、実際に想定している周波数と異なってしまうのはなぜか知りたいです。
よろしくお願いいたします。
tend = 5; %計算時間
dt = 0.001; %時間刻み
tnumber = 5001; %時間のサンプリング数
%一時間数的に周波数が増加する波形を生成 ( F(Hz)=12t(s) とする)
F = 0; %最初の周波数
F_k = 12; %周波数の傾き
f = zeros(tnumber,1); %周波数を格納する行列
X = zeros(tnumber,1); %波形を格納する行列
f(1,1) = F; %初速を1行目にセット
T = zeros(tnumber,1); %時間の行列
j = 2;
t = dt;
% t < tend の間の数値積分
while t < tend
f(j,1) = F_k*t; %ローラーの速度V[m/s]が一時間数的に増加
X(j,1) = sin(2*pi*f(j,1)*t); %外力Fの行列
T(j,1) = t;
j = j+1;
t = dt+t;
end
%変位Xのスペクトログラム
figure(1);
spectrogram(X,128,120,128,1000,'yaxis');
xlabel('t[s]');
ylabel('Xの周波数[Hz]');
ylim([0 200]);
box on
%想定している周波数グラフ
figure(2);
plot(T,f,'.','MarkerSize',4);
xlabel('t[s]');
ylabel('f[Hz]');
box on
2 commentaires
Atsushi Ueno
le 9 Déc 2021
Déplacé(e) : Atsushi Ueno
le 17 Août 2022
>スペクトログラムに表れた周波数が、実際に想定している周波数と異なってしまうのはなぜか知りたいです
理屈が分からず説明出来ませんが、chirp関数を使って同じ目的の信号を作ると意図した通りに表示されました。
t = 0:0.001:5; % f = 12*t; % X = sin(2*pi*f.*t); % ←これだと2倍の周波数が表示される
X = chirp(t,0,5,60); % 0[s]で0[Hz], 5[s]で60[Hz]
spectrogram(X,128,120,128,1000,'yaxis');
xlabel('t[s]'); ylabel('Xの周波数[Hz]'); ylim([0 200]);
Atsushi Ueno
le 9 Déc 2021
Déplacé(e) : Atsushi Ueno
le 17 Août 2022
chirp関数から必要部のみ抜粋する(ph0=0,f0=0,複素数や曲線を除く)と、下記の様になりました。
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828535/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828540/image.png)
type chirp % ← calculateChirp()に着目
f0=0; t1=5; t = 0:0.001:t1; f = 12*t;
X1 = sin(2*pi*f.*t); % ←これだと2倍の周波数が表示される
X2 = sin(2*pi*f(end)*(t.^2)/t1/2); % ←意図した表示になる
Réponse acceptée
Toru Ikegami
le 10 Déc 2021
スペクトログラムに表示されるような瞬間的な周波数(instantaneous frequency,以下
) は,信号の位相の時間微分で定義されるからというのがお答えになるでしょうか.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829135/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829140/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829145/image.png)
単純なサイン波はωを時間によらない定数として
と書けるので,時刻によらず
になります.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829150/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829155/image.png)
ωが時間に依存している場合には事情が変わって
となるので
となります.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829160/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829165/image.png)
特にωが時刻に比例している場合(
)には
となるので,各時刻での瞬間的な角周波数は,設定した周波数の2倍となります.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829170/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/829175/image.png)
t = 0:0.001:5;
f = 12*t;
X1 = sin(2*pi*f.*t); %
X2 = sin( pi*f.*t); % <-Instantaneous Frequency が設定の二倍になることを見越して位相を1/2に.
spectrogram(X1,128,120,128,1000,'yaxis');
spectrogram(X2,128,120,128,1000,'yaxis');
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matched Filter and Ambiguity Function dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!