0

spectrogram以下に投稿されたものが、特定の非定常信号の真の表現であるかどうかを知りたいです。

それが本当の表現である場合、プロットの特定の機能についていくつか質問があります...

横軸が 0->.25 の場合、最高周波数までの信号成分が表示されるのはなぜですか? 最初の期間が与えられた場合t1、信号の周波数のみが表示されるはずx1です。さらに、2 番目の期間が与えられるとt2、信号の周波数のみが表示されるはずx2です。しかし、それは私が以下に投稿したものではありませんspectrogram

スペクトログラムにこれらの特徴が見られる理由を説明していただけますか?

スペクトログラムと方程式 ここに画像の説明を入力

コード:

% Time specifications:
Fs = 8000;                       % samples per second
dt = 1/Fs;                       % seconds per sample
StopTime = 1;                    % seconds
t = (0:dt:StopTime-dt);             % seconds

t1 = (0:dt:.25);
t2 = (.25:dt:.50);
t3 = (.5:dt:.75);
t4 = (.75:dt:1);

 x1 = (10)*sin(2*pi*10*t1);
x2 = (10)*sin(2*pi*20*t2) + x1;
x3 = (10)*sin(2*pi*30*t3) + x2;
x4 = (10)*sin(2*pi*40*t4) + x3;


NFFT = 2 ^ nextpow2(length(t));     % Next power of 2 from length of y
Y    = fft(x4, NFFT);
f    = Fs / 2 * linspace(0, 1, NFFT/2 + 1);
%{
figure;
plot(f(1:200), 2 * abs( Y( 1:200) ) );
%}

 T = 0:.01:1;
 spectrogram(x4,10,9,NFFT);
 ylabel('Frequency');
 axis(get(gcf,'children'), [0, 1, 1, 50]);

Update_1 : 提案された回答を試したところ、次のメッセージが表示されました。

??? Out of memory. Type HELP MEMORY for your options.
Error in ==> spectrogram at 168
y = y(1:length(f),:);
Error in ==> stft_1 at 36
spectrogram(x,10,9,NFFT);

使用したコード:

% Time specifications:
Fs = 8000;                       % samples per second
dt = 1/Fs;                       % seconds per sample
StopTime = 1;                    % seconds
t = (0:dt:StopTime-dt);             % seconds

%get a full-length example of each signal component
x1 = (10)*sin(2*pi*10*t);
x2 = (10)*sin(2*pi*20*t);
x3 = (10)*sin(2*pi*30*t);
x4 = (10)*sin(2*pi*40*t);

%construct a composite signal
x = zeros(size(t));
I = find((t >= t1(1)) & (t <= t1(end)));
x(I) = x1(I);
I = find((t >= t2(1)) & (t <= t2(end)));
x(I) = x2(I);
I = find((t >= t3(1)) & (t <= t3(end)));
x(I) = x3(I);
I = find((t >= t4(1)) & (t <= t4(end)));
x(I) = x4(I);

NFFT = 2 ^ nextpow2(length(t));     % Next power of 2 from length of y
Y    = fft(x, NFFT);
f    = Fs / 2 * linspace(0, 1, NFFT/2 + 1);
%{
figure;
plot(f(1:200), 2 * abs( Y( 1:200) ) );
 %}

T = 0:.01:1;
spectrogram(x,10,9,NFFT);
ylabel('Frequency');
  axis(get(gcf,'children'), [0, 1, 1, 50]);

更新_2

% Time specifications:
Fs = 8000;                       % samples per second
dt = 1/Fs;                       % seconds per sample
 StopTime = 1;                    % seconds
  t = (0:dt:StopTime-dt);             % seconds
  t1 = ( 0:dt:.25);
  t2 = (.25:dt:.50);
  t3 = (.5:dt:.75);
  t4 = (.75:dt:1);

  %get a  full-length example of each signal component
 x1 = (10)*sin(2*pi*100*t);
 x2 = (10)*sin(2*pi*200*t);
 x3 = (10)*sin(2*pi*300*t);
 x4 = (10)*sin(2*pi*400*t);

 %construct a composite signal
 x = zeros(size(t));
 I = find((t >= t1(1)) & (t <= t1(end)));
 x(I) = x1(I);
 I = find((t >= t2(1)) & (t <= t2(end)));
 x(I) = x2(I);
 I = find((t >= t3(1)) & (t <= t3(end)));
 x(I) = x3(I);
 I = find((t >= t4(1)) & (t <= t4(end)));
 x(I) = x4(I);

 NFFT = 2 ^ nextpow2(length(t));     % Next power of 2 from length of y
 Y    = fft(x, NFFT);
 f    = Fs / 2 * linspace(0, 1, NFFT/2 + 1);
 %{
 figure;
 plot(f(1:200), 2 * abs( Y( 1:200) ) );
 %}

 T = 0:.001:1;
 spectrogram(x,10,9);
 ylabel('Frequency');
 axis(get(gcf,'children'), [0, 1, 1, 100]);

ディペクトログラム_2 : ここに画像の説明を入力

4

1 に答える 1

1

あなたが企んでいると思っていることを企んでいるとは思いません。時間領域で信号をプロットして、期待どおりに見えるようにする必要があります... plot(x4). あなたの信号は、x1、x2、x3、x4 と考えていると思います。ただし、表示しているMatlabコードに基づくと、そうではありません。

代わりに、信号は x1+x2+x3+x4 をすべて重ね合わせたものです。その結果、10、20、30、40 Hz の信号成分が、信号の一時的な起動による他の成分と共に見られるはずです。

必要なシグナルを取得するには、次のようにする必要があります。

%get a full-length example of each signal component
t = (0:dt:StopTime-dt);
x1 = (10)*sin(2*pi*10*t);
x2 = (10)*sin(2*pi*20*t);
x3 = (10)*sin(2*pi*30*t);
x4 = (10)*sin(2*pi*40*t);

%construct a composite signal from the four signals above
x = zeros(size(t)); %allocate an empty vector of the correct size
I = find((t >= t1(1)) & (t <= t1(end)));
x(I) = x1(I);
I = find((t >= t2(1)) & (t <= t2(end)));
x(I) = x2(I);
I = find((t >= t3(1)) & (t <= t3(end)));
x(I) = x3(I);
I = find((t >= t4(1)) & (t <= t4(end)));
x(I) = x4(I);

x次に、時間領域 ( ) で新しい信号をプロットして、目的の信号であるplot(x)ことを確認します。最後に、実行できますspectrogram

各期間 (t1 と t2 の間、t2 と t3 の間、そして t3 と t4 の間) の間の遷移でスペクトログラムにアーティファクトが表示されることに注意してください。信号アーティファクトは、異なる信号周波数間の不連続な遷移中に信号が複雑であることを反映しています。

于 2014-12-31T02:08:49.113 に答える