I have created MATLAB GUI for my project. I want to display the absolute values of energy in audio on gui and resulting audio graph also on GUI. But I' getting results on MATLAB command prompt and its displaying separate figures but not on GUI axes?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear('all');
close('all');
[f,fs] = audioread('ias.wav');
N = size(f,1); % Determine total number of samples in audio file
figure; hold
subplot(2,1,1);
plot(1:N, f(:,1));
title('Left Channel');
subplot(2,1,2);
plot(1:N, f(:,1));
title('Right Channel');
n = 2;
fprintf('The sum of the absoulte values (Before filtering) is: \n');
fff = fft(f);
h = sum(abs(fff));
max(f)
disp(h)
beginFreq = 700 / (fs/2);
endFreq = 1600 / (fs/2);
[b,a] = butter(n, [beginFreq, endFreq], 'bandpass');
fOut = filter(b, a, f);
% Construct audioplayer object and play
%p = audioplayer(fOut, fs);
%p.play;
fprintf('The sum of the absoulte values (After filtering) is: \n');
figure;
plot(filter(b, a, f))
ggg = fft(f);
h = sum(abs(ggg));
disp(h)
fprintf('Sampling Frequency is: \n');
disp(fs)
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio Processing Algorithm Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!