plotting mat file with different sampling frequencies.. COMMENTS PLEASE
8 ビュー (過去 30 日間)
古いコメントを表示
I'm given this g(t) sound signal. I'm supposed to sample this signal with sampling frequencies 8KHz and 4KHz, then plot these two sampled signals. I tried until doing the sampling part, but don't know how to plot it..I googled this but got no useful information. The g(t) signal is given as g1.mat and it's a 48000*1 double struct.
%%Sampling
x1 = load('g1.mat');
f = fieldnames(x1);
sound(x1.(f{1}),8000);
I got until here but can't proceed..Can anyone help me plot the g(t) signal sampled at 8KHz, 4Khz on the frequency domain? By the way, if i change sound(x1.(f{1}),8000); this part to 4000, the duration of the sound is different. I was asked to make the duration same. How can i modify this too?
Thanks
回答 (1 件)
Walter Roberson
2018 年 6 月 16 日
t = (0:length(x1.f1)-1)/8000;
plot(t, x1.f1)
To make the duration the same, you need to resample. There are several ways to do that. Perhaps some particular resampling techniques have been discussed in class?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Audio I/O and Waveform Generation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!