How to use findpeaks in the frequency domain?
Show older comments
I'm able to use findpeaks to find out the amplitude and time of each mode but i'm trying to use it to also find frequency, below was my attempt however as I am still very new to this software I was looking for a little help?
clear;
clc;
close all;
[audio_file, Fs] = audioread("honours_gun.wav");
audio_file = audio_file(:, 1);
select = audio_file;
findpeaks(select,Fs,'MinPeakDistance', 0.001);
figure(2), semilogx(audio_file), xlabel('Frequency, Hz'), ylabel('magnitude');
I'm able to plot the frequency with a logarithmic scale and if I could manage to identify the peaks I will have all the information from the sample I need.
1 Comment
[pks,locs]=findpeaks(select,Fs,'MinPeakDistance', 0.001);
You didn't provide anywhere for findpeaks to tell you what the answer was...
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!