Quantizing a Sine Wave for given intervals

3 ビュー (過去 30 日間)
Gayathri Thilakrathne
Gayathri Thilakrathne 2020 年 11 月 13 日
回答済み: Walter Roberson 2020 年 11 月 13 日
How can I program a code for quantizing a sine wave given quantization levels?
As an example it has given that the number of quantization levels are n=8. How can I do this?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 11 月 13 日
One way to do this is to build a vector of (n+1) edge values (the first being the minimum signal value and the last being the maximum signal value), and to use discretize() to get out the number of which "bin" each sample would fall into. Then use that number to index back into the list of levels to get the quantized version of the signal.
bins = discretize(YourSignal, edges);
Quantized_signal = edges(bins);

カテゴリ

Help Center および File ExchangeFractals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by