how reshape the separated signal to original signal ?

1 回表示 (過去 30 日間)
abdullah qasim
abdullah qasim 2019 年 2 月 27 日
コメント済み: abdullah qasim 2019 年 2 月 27 日
hi every one
If I have the following vectors
x= [1 2 -6 9 -7 8 -8 -5 2 4 -6 4 -4 -5 -7 6 10 2 3 7 -8 9 -8 -5 4 -6]
Xp=x(x>0)
Xn=x(x<0)
after separated the signal is transmitted
fr=[length(Xp), Xp, Xn]
then in the recevier Rx
rp=fr(2:fr(1)+1); % positive Rx
rn=fr(2 + fr(1):end); %negativ Rx
then I want to reshape the vector as original vectors
can any one help me
thank u very much

採用された回答

KSSV
KSSV 2019 年 2 月 27 日
YOu pick the indices and get what you want.
x= [1 2 -6 9 -7 8 -8 -5 2 4 -6 4 -4 -5 -7 6 10 2 3 7 -8 9 -8 -5 4 -6]
Xp=x(x>0) ; idxp = x>0 ;
Xn=x(x<0) ; idxn = x<0 ;
% after separated the signal is transmitted
fr=[length(Xp), Xp, Xn]
% then in the recevier Rx
rp=fr(2:fr(1)+1); % positive Rx
rn=fr(2 + fr(1):end); %negativ Rx
iwant = zeros(size(x)) ;
iwant(idxp) = rp ;
iwant(idxn) = rn ;
Note that, the above code can be optimized by using completely indices.
  1 件のコメント
abdullah qasim
abdullah qasim 2019 年 2 月 27 日
thank u very much bro

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by