<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MBDT for RADAR中的主题 Local maxima detection using SPT</title>
    <link>https://community.nxp.com/t5/MBDT-for-RADAR/Local-maxima-detection-using-SPT/m-p/743813#M34</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;&lt;/H1&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20615iCA8A6C5BC8942036/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;INTRODUCTION&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To explain why we need to local maxima detection in RADAR, let us take the simplest scenario. Suppose that we have only one object in front of the RADAR. Then the demodulated signal from a chirp is a sinusoid with the frequency proportional to the range between the RADAR and the object. To find the frequency of the sinusoid we compute its DFT, then we find the peaks of the DFT magnitude. There will be only one peak at frequency of the sinusoid.&lt;/P&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;/H1&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;/H1&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 22px; color: #000080;"&gt;DATA PROCESSING&amp;nbsp;FLOWCHART&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data flow of the MATALB script is presented in the following diagram. The input data for the local maxima detection algorithm is obtained from the SPT input data by applying range FFT, Doppler FFT, and beam forming.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR style="height: 514px;"&gt;&lt;TD style="text-align: center; height: 514px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20621iDAD3328970D766B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="text-align: center; height: 25px;"&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Fig. 2:&amp;nbsp;&lt;/SPAN&gt;Data processing flowchart&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;SPT INPUT DATA&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data received by the SPT is made of demodulated signal and can be organized as a 3 dimensional array in the following way: there is a page for each antenna, and each page contains a matrix where each column contains the samples of a chirp.&lt;/P&gt;&lt;P&gt;NOTE: In MATLAB we refer to the third dimension as pages. For example v(:,:,1) is the first page of v.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20665iD7FE13318DD5EF79/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 2:&amp;nbsp;SPT input data representation&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of bits used to retain the operands&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;NBITS = 16;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of bins for histogram&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;B = 46;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Maximum range that can be detected&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;max_range = 150;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The radar can also detect the negative velocities and its range is in fact [-max_velocity, max_velocity].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;max_velocity = 100;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of samples per chirp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;M = 512;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of chirps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;N = 256;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of antennas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;P = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% We take as input the sum of two 3D sinusoids. This is the case when there are two objects in front of the radar.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the first dimension or the two frequencies of each chirp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fs1 = 150.5 / M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fs2 = 100.5 / M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the second dimension or the two Doppler frequencies&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fc1 = -99.5 / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fc2 =&amp;nbsp; 99.5 / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the third dimension&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fa1 = 1.5 / P;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fa2 = 0.5 / P;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ts = (0:M-1)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;tc = 0:N-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ta(1, 1, : ) = 0:P-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ts = repmat(ts, [1, N, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;tc = repmat(tc, [M, 1, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ta = repmat(ta, [M, N, 1]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% SPT input data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data = sin(2*pi*(fs1*ts + fc1*tc + fa1*ta))+&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;cos(2*pi*(fs2*ts + fc2*tc + fa2*ta))+&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;randn(M, N, P);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data = input_data / max(max(max(input_data)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% SPT input data as 16 bits fixed-point data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data_rs = round_and_saturate(input_data, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;RANGE FFT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output array of the range FFT is obtained by replacing each column of the input array with its DFT. As described in the introduction, from each such DFT one can find the ranges of all objects found in front of the RADAR.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20714i255D18ED4AF6A141/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 3: Range FFT input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Generate window coefficients for range FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% In the radar application, the signals of interest are narrowband sinusoids of widely differing strengths (primarily as a consequence of the inverse fourth power variation in radar signal strength with radar range) and the usage of a window function with low sidelobes is crucial for preventing one or more powerful signals from drowning out weaker reflectors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_rangeFFT = reshape(window(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'chebwin'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;, M), [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_rangeFFT_rs = round_and_saturate(window_rangeFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Perform Range FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% For each line a FFT is performed. The negative frequencies are discarded. The frequencies with significant magnitudes indicates the presents of an&lt;/SPAN&gt; &lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;object at a specific distance. The distance is proportional with the frequency.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;exwindow_rangeFFT = repmat(window_rangeFFT, [1, N, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT = fft(input_data_rs .* exwindow_rangeFFT, [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT = output_rangeFFT(1:end/2, :, : )&amp;nbsp;/ M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT_rs = round_and_saturate(output_rangeFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;DOPPLER FFT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doppler FFT has as input the output array of the range FFT. Similar with the range FFT case, the Doppler FFT output array is obtained by replacing each line of the input array with its DFT. From each such DFT one could deduce the velocities of all objects found in front of the radar. More over from the matrix of each page one could deduce the distinct pairs (range, velocities) of all objects found in front of the radar.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20754iCCCB980A6C718B2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 4:&amp;nbsp;Doppler FFT input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Generate window coefficients for Doppler FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_dopplerFFT = reshape(window(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'chebwin'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;, N), [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_dopplerFFT_rs = round_and_saturate(window_dopplerFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Perform Doppler FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% For each column a FFT is performed. The frequencies with significant magnitudes indicates the presents of an object with a specific velocity. The velocity is proportional with the frequency.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;exwindow_dopplerFFT = repmat(reshape(window_dopplerFFT, 1, []), [M/2, 1, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_dopplerFFT = fft(output_rangeFFT_rs .* exwindow_dopplerFFT, [], 2) / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_dopplerFFT = [output_dopplerFFT(:, end/2 + 1:end, : ) output_dopplerFFT(:, 1:end/2, :)];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 13.0pt;"&gt;output_rangeFFT_rs = round_and_saturate(output_dopplerFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;BEAM FORMING&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peak search detects the magnitude peaks of the matrix obtained from beam forming. The beam forming cancels the time delay between the signals of any group of two adjacent antennas and adds the resulted signals. This is accomplished performing an FFT for each page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20805iE5784D5E96BFFEED/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 5: Beam forming input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = fft(output_rangeFFT_rs, 16, 3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = abs(fftOut / 16) .^ 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% We get data ready to be used by SPT, converting from real data type to log2 data type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = log2(fftOut) + B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut_rs = round_and_saturate(fftOut/2^6, 15) * 2^6;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftMag = squeeze(max(fftOut_rs, [], 3));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Compute a histogram for each range&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;rangeHistogram = zeros(M/2, B);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;edges = 0:B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [tmpHist, ~] = histcounts(fftMag(m, : ), edges);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangeHistogram(m, : )&amp;nbsp;= tmpHist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Determine the threshold for each range&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;threshold = ones(1, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpHist = rangeHistogram(m, : );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [~, ind] = max(tmpHist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;(tmpHist(ind) ~= 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ind = ind + 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; threshold(m) = ind-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;LOCAL MAXIMA DETECTION&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beam forming has as output a matrix. One peak of this matrix represents an object with a specific pair (range, velocity). To find the peaks local maxima detection is used.&lt;/P&gt;&lt;P&gt;The output of the local maxima detection is a matrix that has as line indexes all detectable ranges, and as column indexes all detectable velocities. The matrix contains only 1s and 0s. Each element with value 1 corresponds to least one detected object. The object has its range and velocity that element coordinates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;localMaxInput = fftMag * 2^8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;localMaxThreshold = threshold * 2^8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;outMaxRange = zeros(N, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;outMaxDoppler = zeros(N, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Data Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_dattyp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOG2'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Pre-processing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; preproc = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_PROCESSING'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Threshold Compare (valid only for local maxima)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thld_cmp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'THLD_ENABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Tagged&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_tag = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_TAG'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Local not Global maxima&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loc_n_abs = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOCAL_MAX'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Tag not bitfield (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tag_n_bitfld = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'TAGGED_VEC'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Cyclic extension (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cyc_extn = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'CYC_EXTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN enable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_en = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXSN_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN operand Multiplicity select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_sel = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXS16'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Don't care&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outMaxRange(m, : ) = maxs_mex(complex(localMaxThreshold(m)), complex(localMaxInput(m, :)), in_dattyp, preproc, thld_cmp, in_tag, loc_n_abs, tag_n_bitfld, cyc_extn, maxsn_en, maxsn_sel);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; n = 1:N&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Data Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_dattyp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOG2'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Pre-processing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; preproc = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_PROCESSING'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Threshold Compare (valid only for local maxima)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thld_cmp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'THLD_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Tagged&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_tag = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'TAGGED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Local not Global maxima&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loc_n_abs = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOCAL_MAX'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Tag not bitfield (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tag_n_bitfld = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'PACKED_BITFLD'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Cyclic extension (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cyc_extn = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_CYC_EXTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN enable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_en = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXSN_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN operand Multiplicity select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_sel = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXS16'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Don't care&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outMaxDoppler(:, n) = maxs_mex(complex(0), complex(outMaxRange(:, n)), in_dattyp, preproc, thld_cmp, in_tag, loc_n_abs, tag_n_bitfld, cyc_extn, maxsn_en, maxsn_sel);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 13.0pt;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;RESULT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fist image below is the beam forming result which is also the local maxima detection input, and the second image below is the local maxima detection output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_11.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20861i4580E89E13609162/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_11.png" alt="pastedImage_11.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 6: Input and output of Local maxima detection&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script used in this example is attached below.&lt;/P&gt;&lt;P&gt;We hope you find this information useful. Feel free to LIKE this article and comment below.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jan 2018 13:44:47 GMT</pubDate>
    <dc:creator>iulianbulancea</dc:creator>
    <dc:date>2018-01-22T13:44:47Z</dc:date>
    <item>
      <title>Local maxima detection using SPT</title>
      <link>https://community.nxp.com/t5/MBDT-for-RADAR/Local-maxima-detection-using-SPT/m-p/743813#M34</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;&lt;/H1&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20615iCA8A6C5BC8942036/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;INTRODUCTION&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To explain why we need to local maxima detection in RADAR, let us take the simplest scenario. Suppose that we have only one object in front of the RADAR. Then the demodulated signal from a chirp is a sinusoid with the frequency proportional to the range between the RADAR and the object. To find the frequency of the sinusoid we compute its DFT, then we find the peaks of the DFT magnitude. There will be only one peak at frequency of the sinusoid.&lt;/P&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;/H1&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;/H1&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 600; font-size: 26px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 22px; color: #000080;"&gt;DATA PROCESSING&amp;nbsp;FLOWCHART&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data flow of the MATALB script is presented in the following diagram. The input data for the local maxima detection algorithm is obtained from the SPT input data by applying range FFT, Doppler FFT, and beam forming.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR style="height: 514px;"&gt;&lt;TD style="text-align: center; height: 514px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20621iDAD3328970D766B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="text-align: center; height: 25px;"&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Fig. 2:&amp;nbsp;&lt;/SPAN&gt;Data processing flowchart&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;SPT INPUT DATA&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data received by the SPT is made of demodulated signal and can be organized as a 3 dimensional array in the following way: there is a page for each antenna, and each page contains a matrix where each column contains the samples of a chirp.&lt;/P&gt;&lt;P&gt;NOTE: In MATLAB we refer to the third dimension as pages. For example v(:,:,1) is the first page of v.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20665iD7FE13318DD5EF79/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 2:&amp;nbsp;SPT input data representation&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of bits used to retain the operands&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;NBITS = 16;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of bins for histogram&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;B = 46;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Maximum range that can be detected&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;max_range = 150;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The radar can also detect the negative velocities and its range is in fact [-max_velocity, max_velocity].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;max_velocity = 100;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of samples per chirp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;M = 512;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of chirps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;N = 256;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Number of antennas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;P = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% We take as input the sum of two 3D sinusoids. This is the case when there are two objects in front of the radar.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the first dimension or the two frequencies of each chirp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fs1 = 150.5 / M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fs2 = 100.5 / M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the second dimension or the two Doppler frequencies&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fc1 = -99.5 / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fc2 =&amp;nbsp; 99.5 / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% The two frequencies in the third dimension&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fa1 = 1.5 / P;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fa2 = 0.5 / P;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ts = (0:M-1)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;tc = 0:N-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ta(1, 1, : ) = 0:P-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ts = repmat(ts, [1, N, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;tc = repmat(tc, [M, 1, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;ta = repmat(ta, [M, N, 1]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% SPT input data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data = sin(2*pi*(fs1*ts + fc1*tc + fa1*ta))+&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;cos(2*pi*(fs2*ts + fc2*tc + fa2*ta))+&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;randn(M, N, P);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data = input_data / max(max(max(input_data)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% SPT input data as 16 bits fixed-point data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;input_data_rs = round_and_saturate(input_data, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;RANGE FFT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output array of the range FFT is obtained by replacing each column of the input array with its DFT. As described in the introduction, from each such DFT one can find the ranges of all objects found in front of the RADAR.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20714i255D18ED4AF6A141/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 3: Range FFT input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Generate window coefficients for range FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% In the radar application, the signals of interest are narrowband sinusoids of widely differing strengths (primarily as a consequence of the inverse fourth power variation in radar signal strength with radar range) and the usage of a window function with low sidelobes is crucial for preventing one or more powerful signals from drowning out weaker reflectors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_rangeFFT = reshape(window(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'chebwin'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;, M), [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_rangeFFT_rs = round_and_saturate(window_rangeFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Perform Range FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% For each line a FFT is performed. The negative frequencies are discarded. The frequencies with significant magnitudes indicates the presents of an&lt;/SPAN&gt; &lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;object at a specific distance. The distance is proportional with the frequency.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;exwindow_rangeFFT = repmat(window_rangeFFT, [1, N, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT = fft(input_data_rs .* exwindow_rangeFFT, [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT = output_rangeFFT(1:end/2, :, : )&amp;nbsp;/ M;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_rangeFFT_rs = round_and_saturate(output_rangeFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;DOPPLER FFT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doppler FFT has as input the output array of the range FFT. Similar with the range FFT case, the Doppler FFT output array is obtained by replacing each line of the input array with its DFT. From each such DFT one could deduce the velocities of all objects found in front of the radar. More over from the matrix of each page one could deduce the distinct pairs (range, velocities) of all objects found in front of the radar.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20754iCCCB980A6C718B2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 4:&amp;nbsp;Doppler FFT input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Generate window coefficients for Doppler FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_dopplerFFT = reshape(window(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'chebwin'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;, N), [], 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;window_dopplerFFT_rs = round_and_saturate(window_dopplerFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Perform Doppler FFT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% For each column a FFT is performed. The frequencies with significant magnitudes indicates the presents of an object with a specific velocity. The velocity is proportional with the frequency.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;exwindow_dopplerFFT = repmat(reshape(window_dopplerFFT, 1, []), [M/2, 1, P]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_dopplerFFT = fft(output_rangeFFT_rs .* exwindow_dopplerFFT, [], 2) / N;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;output_dopplerFFT = [output_dopplerFFT(:, end/2 + 1:end, : ) output_dopplerFFT(:, 1:end/2, :)];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 13.0pt;"&gt;output_rangeFFT_rs = round_and_saturate(output_dopplerFFT, NBITS);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;BEAM FORMING&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peak search detects the magnitude peaks of the matrix obtained from beam forming. The beam forming cancels the time delay between the signals of any group of two adjacent antennas and adds the resulted signals. This is accomplished performing an FFT for each page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20805iE5784D5E96BFFEED/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 5: Beam forming input data processing&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = fft(output_rangeFFT_rs, 16, 3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = abs(fftOut / 16) .^ 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% We get data ready to be used by SPT, converting from real data type to log2 data type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut = log2(fftOut) + B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftOut_rs = round_and_saturate(fftOut/2^6, 15) * 2^6;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;fftMag = squeeze(max(fftOut_rs, [], 3));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Compute a histogram for each range&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;rangeHistogram = zeros(M/2, B);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;edges = 0:B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [tmpHist, ~] = histcounts(fftMag(m, : ), edges);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangeHistogram(m, : )&amp;nbsp;= tmpHist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Determine the threshold for each range&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;threshold = ones(1, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmpHist = rangeHistogram(m, : );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [~, ind] = max(tmpHist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;(tmpHist(ind) ~= 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ind = ind + 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; threshold(m) = ind-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;LOCAL MAXIMA DETECTION&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beam forming has as output a matrix. One peak of this matrix represents an object with a specific pair (range, velocity). To find the peaks local maxima detection is used.&lt;/P&gt;&lt;P&gt;The output of the local maxima detection is a matrix that has as line indexes all detectable ranges, and as column indexes all detectable velocities. The matrix contains only 1s and 0s. Each element with value 1 corresponds to least one detected object. The object has its range and velocity that element coordinates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;localMaxInput = fftMag * 2^8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;localMaxThreshold = threshold * 2^8;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;outMaxRange = zeros(N, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;outMaxDoppler = zeros(N, M/2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; m = 1:M/2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Data Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_dattyp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOG2'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Pre-processing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; preproc = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_PROCESSING'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Threshold Compare (valid only for local maxima)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thld_cmp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'THLD_ENABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Tagged&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_tag = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_TAG'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Local not Global maxima&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loc_n_abs = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOCAL_MAX'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Tag not bitfield (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tag_n_bitfld = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'TAGGED_VEC'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Cyclic extension (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cyc_extn = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'CYC_EXTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN enable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_en = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXSN_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN operand Multiplicity select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_sel = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXS16'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Don't care&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outMaxRange(m, : ) = maxs_mex(complex(localMaxThreshold(m)), complex(localMaxInput(m, :)), in_dattyp, preproc, thld_cmp, in_tag, loc_n_abs, tag_n_bitfld, cyc_extn, maxsn_en, maxsn_sel);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: blue;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt; n = 1:N&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Data Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_dattyp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOG2'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Pre-processing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; preproc = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_PROCESSING'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Threshold Compare (valid only for local maxima)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thld_cmp = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'THLD_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Input Tagged&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_tag = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'TAGGED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Local not Global maxima&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loc_n_abs = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'LOCAL_MAX'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Tag not bitfield (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tag_n_bitfld = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'PACKED_BITFLD'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Cyclic extension (valid only for local maximum calculation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cyc_extn = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'NO_CYC_EXTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN enable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_en = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXSN_DISABLED'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% MAXSN operand Multiplicity select&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxsn_sel = &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: #a020f0;"&gt;'MAXS16'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0pt; color: forestgreen;"&gt;% Don't care&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outMaxDoppler(:, n) = maxs_mex(complex(0), complex(outMaxRange(:, n)), in_dattyp, preproc, thld_cmp, in_tag, loc_n_abs, tag_n_bitfld, cyc_extn, maxsn_en, maxsn_sel);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 13.0pt;"&gt;end&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;SPAN style="color: #000080; font-size: 22px;"&gt;RESULT&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fist image below is the beam forming result which is also the local maxima detection input, and the second image below is the local maxima detection output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_11.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20861i4580E89E13609162/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_11.png" alt="pastedImage_11.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; font-size: 13px;"&gt;Fig. 6: Input and output of Local maxima detection&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script used in this example is attached below.&lt;/P&gt;&lt;P&gt;We hope you find this information useful. Feel free to LIKE this article and comment below.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 13:44:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MBDT-for-RADAR/Local-maxima-detection-using-SPT/m-p/743813#M34</guid>
      <dc:creator>iulianbulancea</dc:creator>
      <dc:date>2018-01-22T13:44:47Z</dc:date>
    </item>
  </channel>
</rss>

