History

tests/calc_snr.c : Fix minor bug in analysis routines.

Erik de Castro Lopo committed 20 years ago

Commit ad15d5d1 parent 3e36e651 file · +3 −2Browse files

Unified · Split

tests/calc_snr.c+3−2
@@ -158,11 +158,12 @@ find_snr (const double *magnitude, int len, int expected_peaks) · 157 unmodified lines
158158 { peaks [peak_count].peak = magnitude [k] ;
159159 peaks [peak_count].index = k ;
160160 peak_count ++ ;
161+ qsort (peaks, peak_count, sizeof (PEAK_DATA), peak_compare) ;
161162 }
162163 else if (magnitude [k] > peaks [MAX_PEAKS - 1].peak)
163− { qsort (peaks, MAX_PEAKS, sizeof (PEAK_DATA), peak_compare) ;
164− peaks [MAX_PEAKS - 1].peak = magnitude [k] ;
164+ { peaks [MAX_PEAKS - 1].peak = magnitude [k] ;
165165 peaks [MAX_PEAKS - 1].index = k ;
166+ qsort (peaks, MAX_PEAKS, sizeof (PEAK_DATA), peak_compare) ;
166167 } ;
167168 } ;
168169 } ;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t