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.
[audio_file, Fs] = audioread("honours_gun.wav"); L = size(audio_file,1); Ts = 1/Fs; % Sampling Interval Fn = Fs/2; % Nyquist Frequency FT_af = fft(audio_file)/L; % Fourier Transform Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector Iv = 1:numel(Fv); % Index Vector [PksL,LocsL] = findpeaks(abs(FT_af(Iv,1))*2, 'MinPeakHeight',4E-3); [PksR,LocsR] = findpeaks(abs(FT_af(Iv,2))*2, 'MinPeakHeight',4E-3); figure subplot(2,1,1) plot(Fv, abs(FT_af(Iv,1))*2) hold on plot(Fv(LocsL), PksL, '^r', 'MarkerFaceColor','r') hold off ylabel('Amplitude') title('Left Channel') subplot(2,1,2) plot(Fv, abs(FT_af(Iv,2))*2) hold on plot(Fv(LocsR), PksR, '^r', 'MarkerFaceColor','r') hold off xlabel('Frequency (Hz)') ylabel('Amplitude') title('Left Channel')
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.