필터 지우기
필터 지우기

Replace elements in a complex matrix

조회 수: 2 (최근 30일)
Angeles Salles
Angeles Salles 2017년 6월 8일
편집: Chaitral Date 2017년 6월 19일
I'm using the signal processing toolbox. When I plot:
spectrogram(a,2^7,(2^7)-1,2^7,250e3)
I see some things in 'a' the figure I want to replace with background noise. For this I made variable 'x' that is a 65x12374 complex double matrix using this code:
x=spectrogram(a,2^7,(2^7)-1,2^7,250e3)
Now I used the marker on the figure of the spectrogram of 'a' to find the indexes for the parts I want to replace and wrote this:
x(-91.95:-94.27)=x(-100:(-94.27--91.95))
I get the error: Warning: Integer operands are required for colon operator when used as index Subscript indices must either be real positive integers or logicals.
The idea is to fill the content between those indexes with the content of some other part of the spectrogram. Then, I would want to turn back 'x' into a normal double matrix to get a new "original signal clean from what I covered.

답변 (1개)

Chaitral Date
Chaitral Date 2017년 6월 19일
편집: Chaitral Date 2017년 6월 19일
For linear indexing, you must use integers. If you want to find out values of x that are between the range -100 to (-94.27--91.95), you can use the below command,
>> x(-100<=x & x<=(-94.27--91.95))
To replace these values from their respective places, you have to use similar technique.

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by