plotting mat file with different sampling frequencies.. COMMENTS PLEASE
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
Risposte (1)
Walter Roberson
il 16 Giu 2018
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 Commenti
Vedere anche
Categorie
Scopri di più su Audio I/O and Waveform Generation in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!