Automatic detection of the maximum and halfmaximum in frequency domain

3 visualizaciones (últimos 30 días)
VG
VG el 25 de Mzo. de 2022
Respondida: Star Strider el 25 de Mzo. de 2022
Hello ,
I am working with frequency domain data. I wanted to calculate the maximum and halfmaximum of the center peak automatically for every data set. I tried to do that manually and it worked , but I have multiple data sets and I would like to detect the maximum and half maximum for every data set. I have attached an image of the frequency domain data with frequency on x axis and voltage values on y axis.
I have calculated manually using the formula : Q = 0.01173 /(0.01217-0.01103) = fc/x2-x1 and it worked.
Now I want to calculate the Q value for all automatically for all data sets.
Thanks in advance

Respuestas (1)

Star Strider
Star Strider el 25 de Mzo. de 2022
Since you apparently want the value of the peak and tha full-width-half-maximum (FWHM) distance value, use the findpeaks function for both. Use the 'MinPeakProminence' value to isolate the peaks you want. Then, divide the peak value by the FWHM value to calculate ‘Q’. See the findpeaks documentation for details.
However if you want the ‘x’ values of the FWHM points, that is going to be a bit more complicated.
Use the max function to isolate the value and location of the maximum peak of interest.
The half-maximum value depends on how the peak is defined, and you need to decide that. Calculate the ‘valleys’ by using the findpeaks function on the negative if the data. Use the 'MinPeakProminence' value to isolate the peaks you want. Once you have the minimum and maximum of the peak, finding the value for the half-maximum is straightforward and finding the associated ‘x’ values infolves using the interp1 function over a narrow range of values near the half-maximum value. If the data are not noisy, this is also straightforward. If they are, a bit more processing will be required first to remove the noise.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by