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 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Audio Processing Algorithm Design 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by