how to eliminate unwanted spikes with peaks

When I plot my signal I notice that some peaks aren't well shaped, as shown in this figure.
This causes problems in my results later.
Is there any function to eliminate these unwanted spikes within the peaks?

댓글 수: 7

Adam
Adam 2017년 7월 31일
What do you mean by 'eliminate' them? Remove the peak entirely or remove the value just less than the peak that causes it to be wider than expected?
asma khedri
asma khedri 2017년 7월 31일
No not the peak entirely, in fact I need the index of the peaks in calculation later, that peaks returns two values since it is wider than expected,it was considered as two peaks.
Adam
Adam 2017년 7월 31일
It shouldn't be if you are using a proper peak detector and there is no trough between the two values.
asma khedri
asma khedri 2017년 7월 31일
I am actually using the CFAR Detector to simulate an FMCW Radar. the peaks are then used to extract the frequency beats thus to calculate the ranges of targets. Here is the part of code
sPeakDetector = phased.CFARDetector('ProbabilityFalseAlarm',1e-3,... 'NumTrainingCells',24,'Method','OS', 'Rank', 18);
peakidx = step(sPeakDetector,abs(xf_dechirp(:,1)),1:num_xf_samp);
Fbeat = beatfreq_vec(peakidx);
ranges= beat2range(Fbeat,sweep_slope)
xf_dechirp is the fft2 of the received reflected signal.
is there a filter that can enhance the signal so it could return sharped peaks.
Would you want all peaks that cover more than one index to be replaced by a single index (single x value) with the highest (or average) value? Like if x(30) = 30 and y is 4.5 there, and x(31) = 31 and y is 4.4 there, to have x(30) = (30+31)/2 and y=4.5, and remove x(31) from the array?
asma khedri
asma khedri 2017년 8월 1일
Yes, I think this can work, but how can I write it properly !
Image Analyst
Image Analyst 2017년 8월 1일
편집: Image Analyst 2017년 8월 1일
It would be easier to show you if you attached the data array. And it would be easier if you had the Image Processing Toolbox so that we can find the weighted centroid of each spike. Do you have that toolbox?

댓글을 달려면 로그인하십시오.

답변 (1개)

Jacob Ward
Jacob Ward 2017년 9월 5일

1 개 추천

You could try interpolating the data to get a clearer peak. Here's an example:
This code generates a peak similar to the one you posted:
x = 10:40;
y = [zeros(1,14) 4.6 4.5 zeros(1,15)];
plot(x,y,'b-')
ylim([0 6])
By interpolating onto a finer x-grid, we get a rounded peak at approximately the right point. You can also try using the 'spline' or 'pchip' methods instead of 'v5cubic' to see if they give you more desirable results
xfine = 10:.2:40;
yfine = interp1(x,y,xfine,'v5cubic');
plot(xfine,yfine,'b-')
ylim([0 6])

카테고리

태그

질문:

2017년 7월 31일

답변:

2017년 9월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by