A list,
Matlab GUI based voice signal spectrum analysis
Ii. Source code
function varargout = Gui1_6(varargin)
% GUI1_6 MATLAB code for Gui1_6.fig
% GUI1_6, by itself, creates a new GUI1_6 or raises the existing
% singleton*.
%
% H = GUI1_6 returns the handle to a new GUI1_6 or the handle to
% the existing singleton*.
%
% GUI1_6('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI1_6.M with the given input arguments.
%
% GUI1_6('Property'.'Value',...). creates anew GUI1_6 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Gui1_6_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Gui1_6_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Gui1_6
% Last Modified by GUIDE v2. 5 22-Sep- 2020. 22:43:04
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Gui1_6_OpeningFcn, ...
'gui_OutputFcn', @Gui1_6_OutputFcn, ...
'gui_LayoutFcn', [],...'gui_Callback'[]);if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Gui1_6 is made visible.
function Gui1_6_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Gui1_6 (see VARARGIN)
% Choose default command line output for Gui1_6
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
set(handles.slider1,'value'.0);
% UIWAIT makes Gui1_6 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Gui1_6_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
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)
global h; h=handles;
global mytimer;
start(mytimer);
global m;
global pyr;
m=0;
global m1; global m2;
m1=1; m2=0;
global abc;
global Fs;
Fs=44100; global pyr; [pyr,Fs]=audioread(abc); sound(pyr,Fs); % Sound playback %n=length(pyr); % pyr1=fft(pyr,n); % A1=abs(pyr1)/(n/2);
% f=linspace(0,Fs/2,n/2);
% plot(handles.axes3,f,A1(1:n/2));
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global abc;
global Fs;
global pyr;
Fs=44100;
[FileName,PathName] = uigetfile('*.mp3'.'Select the audio-file');
abc=fullfile(PathName,FileName);
set(handles.edit1,'String',abc); [pyr,Fs]=audioread(abc); % Sound reads plot(handles. Axes1,pyr); % Display audio time; global t; global num; t=length(pyr(:,1))/Fs;
num=length(pyr(:,1));
t1=sprintf('%.1f',t);
set(handles.edit4,'string',t1);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0.'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor'.'white');
end
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global abc;
global Fs;
global num;
a=100*get(handles.slider1,'value');
%s2=sprintf('%.1f',a); set(handles.edit3,'String',s2);
%v2 = str2double(s2);
v2=a;
v2=round(v2);
num1=round(num);
if(v2<=10)
Copy the code
3. Operation results
Fourth, note
Version: 2014 a