Trying to compress a signal.

16 ビュー (過去 30 日間)
Rafael Ortiz
Rafael Ortiz 2021 年 9 月 26 日
コメント済み: Rafael Ortiz 2021 年 9 月 27 日
Hi guys im trying to compress a signal
n is the time vector given by : n=[0 1 2 3 4 5 6 ] and xn is the vector with the values of the discrete sequence and is: xn=[0 1 2 3 4 1 0]
signal compression is "x(2*n)", x2n= [0 2 2 0 0 0 0] .
Is there any way to calculate these new points in matlab?
Thanks!

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 27 日
compressed_x = x(1:2:end);
  4 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 27 日
n=[0 1 2 3 2 1 0]
n = 1×7
0 1 2 3 2 1 0
x = [0 1 2 3 4 1 0]
x = 1×7
0 1 2 3 4 1 0
n2idx = @(n) n+1;
xn = @(n) x(n2idx(n))
xn = function_handle with value:
@(n)x(n2idx(n))
x2n = @(n) x(n2idx(2*n));
xn(n)
ans = 1×7
0 1 2 3 2 1 0
x2n(n)
ans = 1×7
0 2 4 0 4 2 0
Rafael Ortiz
Rafael Ortiz 2021 年 9 月 27 日
Thank you so much!

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

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 9 月 26 日
that explains all steps of signal compression in a logical order.

カテゴリ

Help Center および File ExchangeSignal Generation and Preprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by