フィルターのクリア

Flip signal (positive and negative)

74 ビュー (過去 30 日間)
abdullah qasim
abdullah qasim 2018 年 6 月 6 日
コメント済み: Image Analyst 2023 年 9 月 17 日
I need help to program a flip-signal to separate the negative signal from the negative and reverse it ?
  1 件のコメント
Rik
Rik 2018 年 6 月 6 日
Have a read here and here. It will greatly improve your chances of getting an answer.

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

採用された回答

Image Analyst
Image Analyst 2018 年 6 月 6 日
I have no idea what you want, but take a look at flipping functions flipud() and fliplr(), as well as masking:
negIndexes = signal < 0;
negValuesOnly = signal(negIndexes); % Extract neg values only, or...
% Set negative values to zero (masking)
noNegatives = signal; % Initialize.
noNegatives(negIndexes) = 0; % Set negatives to zero, positives remain as-is.
% Reverse the signal horizontally
reversedSignal = fliplr(signal);
% Invert the signal vertically
signal = max(signal) - signal;
  4 件のコメント
Souarv De
Souarv De 2023 年 9 月 17 日
@Image Analyst, for inversion of a signal vertically why do you subtract it from the maximum value? Does it not simply the postive values becomes and negative and vice-versa?
Image Analyst
Image Analyst 2023 年 9 月 17 日
You don't have to. You could simply negate it. Like I said, I didn't know what the original poster really wanted.

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

その他の回答 (1 件)

Crispin Foli
Crispin Foli 2020 年 7 月 10 日
to flip the signal about the x-axis (negatives to positives and vice versa), simply use the function gnegate (x).
Where X is the signal you're flipping.
This turns all peaks to troughs and all troughs to peaks.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by