1

I have a signal of 100ms. Fs = 8000 Hz. nbits = 16.

fs_orig = 44100;
nbits = 16;
[signal_orig,fs_orig,nbits]=wavread('oo.wav');
y=resample(signal_orig, 8000,44100);
z=y(1:800,1);
t=(0:1/8000:0.1-1/8000);
plot(t,z);xlabel('Time(s)');ylabel('Amplitude');

How many samples there are I calculated this way

N = fs(Hz)*duration(ms)/1000 N = 8000*100/1000 = 800 samples.

Want to know how i can calculate the length of one period in matlab? How can i see which frequencies are in the signal? The fundamental frequency of the period I can calculate by 1/Period time?

user4390280
  • 33
  • 10

1 Answers1

1

If your signal is periodic (like a sine wave, a sawtooth pulse, etc), you can use seqperiod. If your signal is not periodic, the simplest method is to apply fourier analysis (via fft) and look for peaks in its spectrum, which correspond to the most dominant frequencies.

You should also look into this question.

Edit: if your signal varies highly with time, but is periodic for small sections (typically < 50milliseconds), like a speech signal, I would look into cepstral analysis.

Community
  • 1
  • 1
VHarisop
  • 2,816
  • 1
  • 14
  • 28
  • Given that the OP is loading his data from a WAV file, I'm assuming that the data is not going to contain numerical sequences that seqperiod will detect. Noise and whatnot will probably prevent seqperiod from working. But, the link at the end of your answer is definitely gold. +1! – chipaudette Jan 11 '15 at 12:44