getting 1hertz data from 10 hertz

8 ビュー (過去 30 日間)
sri satya ravi
sri satya ravi 2016 年 9 月 23 日
回答済み: sri satya ravi 2017 年 1 月 10 日
Hi,
I have a 10htz data file. I want to convert that into 1htz. Is there an easy way to downshift the points.
for example: Time 0.1, 0.2, -- -- -- 0.9, 1.0, 1.1, 1.2, -- -- 1.9, 2.0.
I want my output to be just 1, 2, 3, --

採用された回答

sri satya ravi
sri satya ravi 2017 年 1 月 10 日
There is an easier function in matlab called downsample. That works for me ..
Thanks....!!!

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 9 月 24 日
You can get what you asked for (in the second half of your question) from your signal like this:
newSignal = signal(10:10:end);
Of course subsampling a signal speeds it up because the time is now shorter, if you're using the same time scale. Instead of a sound playing in (say) 100 seconds, it will now play the complete sound in only 10 seconds - ten times faster than before. To make a signal be 1 Hz instead of 10 Hz on the same time scale you need to stretch things out - add samples, not get rid of them.
  2 件のコメント
sri satya ravi
sri satya ravi 2016 年 12 月 27 日
Matlab has a simple function called downsample.....That helped but thanks a lot for replying.
Image Analyst
Image Analyst 2016 年 12 月 28 日
Yes, if you have the Signal Processing Toolbox you can use downsample() though I don't know why you'd need a function to do such a simple thing.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by