男女声识别系统

function varargout = bysj(varargin)
% BYSJ MATLAB code for bysj.fig
% BYSJ, by itself, creates a new BYSJ or raises the existing
% singleton*.
%
% H = BYSJ returns the handle to a new BYSJ or the handle to
% the existing singleton*.
%
% BYSJ(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in BYSJ.M with the given input arguments.
%
% BYSJ(‘Property’,’Value’,…) creates a new BYSJ or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before bysj_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to bysj_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 bysj

% Last Modified by GUIDE v2.5 06-Jun-2016 19:16:07

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @bysj_OpeningFcn, …
‘gui_OutputFcn’, @bysj_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 bysj is made visible.
function bysj_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 bysj (see VARARGIN)

% Choose default command line output for bysj
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes bysj wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% — Outputs from this function are returned to the command line.
function varargout = bysj_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;

% ——————————————————————–
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% ——————————————————————–
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
[y,fs]=audioread(uigetfile(‘.‘));
global s
s=y;

% ——————————————————————–
function Untitled_3_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clc;
close all;
close(gcf);
clear;

% — 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 y %声明全局变量y
global fs %声明全局变量fs
sound(y,fs); %播放载入的音频文件,fs是采样频率

% — 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 y
global fs
global t
global n
n=length(y);
n1=1:n;
t=n1/fs;
axes(handles.axes1);
plot(t,y);
title(‘原始音频时域波形’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);
n=length(y); %选取变换的点数
y_p=fft(y,n); %对n点进行傅里叶变换到频域
f=fs*(0:n/2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n/2))) %语音信号的频谱图
title(‘原始音频频谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);
xlim([0 600]);

% — Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
prompt={‘请输入放大倍数’};
defans={‘1.5’};
p=inputdlg(prompt,’input’,1,defans);
p1=str2num(p{1});
fd=p1*y;
sound(fd,fs);
global s
s=fd;

axes(handles.axes1);
plot(fd);
title(‘放大后音频时域波形’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

% ——————————————————————–
function Untitled_4_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% ——————————————————————–
function Untitled_5_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% ——————————————————————–
function Untitled_9_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global a
global fs
global t
global y
zzlb=medfilt1(a,7);
sound(zzlb,fs);
axes(handles.axes1);
plot(t,zzlb);
title(‘中值滤波后的时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)
global s
s=zzlb;

axes(handles.axes2);
n=length(y); %选取变换的点数
y_p=fft(zzlb,n); %对n点进行傅里叶变换到频域
n2=round(t/2);
f=fs*(0:n2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n2))); %语音信号的频谱图
title(‘中值滤波后音频频谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);
xlim([20 600])

% ——————————————————————–
function Untitled_10_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global fs
global Y1
global t
global y
fp=1000;
fc=1200;
as=100;
ap=1;
fs1=22050;
wc=2*fc/fs1;
wp=2*fp/fs1;
[n,wn]=ellipord(wp,wc,ap,as);
[b,a]=ellip(n,ap,as,wn);
x=filter(b,a,Y1);
sound(x,fs);
global s
s=x;

axes(handles.axes1);
plot(t,x);
title(‘双线性低通滤波后的时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);
n=length(x) %选取变换的点数
y_p=fft(x,n); %对n点进行傅里叶变换到频域
f=fs*(0:n/2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n/2))); %语音信号的频谱图
title(‘双线性低通滤波后的频域图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);

% ——————————————————————–
function Untitled_11_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Y2;
global fs;
global t
global y
global n

[b,a]=butter(8,400/22050,’high’);
data=filter(b,a,Y2);
sound(data,fs);
global s
s=data;

axes(handles.axes1);
plot(t,data);
title(‘高通滤波后的时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);

y_p=fft(data,n); %对n点进行傅里叶变换到频域
n2=round(n/2);
f=fs*(0:n2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n2))); %语音信号的频谱图
title(‘高通滤波后音频频谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);
xlim([0 1000]);
% ——————————————————————–
function Untitled_6_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
global a
global t
%prompt={‘均值’,’方差’};
%dlg_title=’input’;
%num_lines=1;
%def={‘0’,’0’};
%answer=inputdlg(prompt,dlg_title,num_lines,def);
%p1=str2num(answer{1});
%p2=str2num(answer{2});
%noise=p2*randn(size(y))+p1;
%a=noise+y;
%sound(a,fs)
%

prompt={‘输入参数1:’};
defans={‘43’};
p=inputdlg(prompt,’输入参数’,1,defans);
p1=str2num(p{1});
a=awgn(y,p1);
sound(a,44100);
global s
s=a;

axes(handles.axes1);
plot(t,a);
title(‘添加高斯噪声后的时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);
n=length(y); %选取变换的点数
y_p=fft(a,n); %对n点进行傅里叶变换到频域
n2=round(n/2);
f=fs*(0:n2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n2))); %语音信号的频谱图
title(‘添加高斯白噪声后音频频谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);
xlim([20 600])

% ——————————————————————–
function Untitled_7_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
global Y1
global t
fc=10000;
y1=modulate(y,fc,fs,’fm’);
Y1=y1+y;
sound(Y1,fs);
global s
s=Y1;

axes(handles.axes1);
plot(t,Y1);
title(‘添加高频噪声后的时域波图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);
n=length(Y1); %选取变换的点数
y_p=fft(Y1,n); %对n点进行傅里叶变换到频域
f=fs*(0:n/2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n/2))); %语音信号的频谱图
title(‘添加高频噪声后的频域谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);

% ——————————————————————–
function Untitled_8_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Y2
global y
global fs
global t
fc=100;
y1=modulate(y,fc,fs,’fm’);
Y2=y1+y;
sound(Y2,fs);
global s
s=Y2;

axes(handles.axes1);
plot(t,Y2);
title(‘添加低频噪声后的时域波图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

axes(handles.axes2);
n=length(Y2); %选取变换的点数
y_p=fft(Y2,n); %对n点进行傅里叶变换到频域
f=fs*(0:n/2-1)/n; % 对应点的频率
plot(f,abs(y_p(1:n/2))); %语音信号的频谱图
title(‘添加低频噪声后的频域谱图’);
xlabel(‘频率Hz’);
ylabel(‘频率幅值’);
xlim([0 600])

% — Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% — Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
!SoundRecorder.exe

% — Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
n=length(y);
n1=1:n;
t=n1/fs;

axes(handles.axes1);
plot(t,y);
title(‘音频时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

[b,a]=butter(8,400/22050,’low’);
data=filter(b,a,y);
axes(handles.axes2);
figure
plot(t,data);
d1zf=get(handles.edit1,’string’);
d1=str2num(d1zf);
d2zf=get(handles.edit4,’string’);
d2=str2num(d2zf);
xlim([d1 d2])

% — Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
n=length(y);
n1=1:n;
t=n1/fs;

axes(handles.axes1);
plot(t,y);
title(‘音频时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

[b,a]=butter(8,175/22050,’low’);
data=filter(b,a,y);
axes(handles.axes2);
figure
plot(t,data);
d1zf=get(handles.edit1,’string’);
d1=str2num(d1zf);
d2zf=get(handles.edit4,’string’);
d2=str2num(d2zf);
xlim([d1 d2])

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

function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (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 edit4 as text
% str2double(get(hObject,’String’)) returns contents of edit4 as a double

% — Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (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

function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (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 edit5 as text
% str2double(get(hObject,’String’)) returns contents of edit5 as a double

% — Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (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

function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (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 edit6 as text
% str2double(get(hObject,’String’)) returns contents of edit6 as a double

% — Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (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

function edit15_Callback(hObject, eventdata, handles)
% hObject handle to edit15 (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 edit15 as text
% str2double(get(hObject,’String’)) returns contents of edit15 as a double

% — Executes during object creation, after setting all properties.
function edit15_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit15 (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

function edit16_Callback(hObject, eventdata, handles)
% hObject handle to edit16 (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 edit16 as text
% str2double(get(hObject,’String’)) returns contents of edit16 as a double

% — Executes during object creation, after setting all properties.
function edit16_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit16 (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

function edit17_Callback(hObject, eventdata, handles)
% hObject handle to edit17 (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 edit17 as text
% str2double(get(hObject,’String’)) returns contents of edit17 as a double

% — Executes during object creation, after setting all properties.
function edit17_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit17 (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

function edit18_Callback(hObject, eventdata, handles)
% hObject handle to edit18 (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 edit18 as text
% str2double(get(hObject,’String’)) returns contents of edit18 as a double

% — Executes during object creation, after setting all properties.
function edit18_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit18 (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 button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

m1zf=get(handles.edit5,’string’);
m1=str2num(m1zf);
m2zf=get(handles.edit6,’string’);
m2=str2num(m2zf);
c=m2-m1;
pl=1/c;
set(handles.edit19,’string’,pl);
if pl>50&&pl<175,set(handles.edit20,’string’,’男声’);
end
if pl>175&&pl<400,set(handles.edit20,’string’,’女声’);
end
function edit19_Callback(hObject, eventdata, handles)
% hObject handle to edit19 (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 edit19 as text
% str2double(get(hObject,’String’)) returns contents of edit19 as a double

% — Executes during object creation, after setting all properties.
function edit19_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit19 (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

function edit20_Callback(hObject, eventdata, handles)
% hObject handle to edit20 (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 edit20 as text
% str2double(get(hObject,’String’)) returns contents of edit20 as a double

% — Executes during object creation, after setting all properties.
function edit20_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit20 (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 button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global y
global fs
n=length(y);
n1=1:n;
t=n1/fs;

axes(handles.axes1);
plot(t,y);
title(‘音频时域图’);
xlabel(‘时间轴/s’)
ylabel(‘幅值 A’)

[b,a]=butter(8,175/22050,’low’);
data=filter(b,a,y);
axes(handles.axes2);
figure
plot(t,data);
d1zf=get(handles.edit1,’string’);
d1=str2num(d1zf);
d2zf=get(handles.edit4,’string’);
d2=str2num(d2zf);
xlim([d1 d2])

% ——————————————————————–
function Untitled_12_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global s
[filename,pathname] = uiputfile(‘*.wav’,’保存为’);
if isequal([filename,pathname],[0,0])
errordlg(‘没有保存’,’出错’);
return;
else
fpath=[pathname filename];
(handles.axes2);
wavwrite(s,44100,fpath);
end

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值