在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → 基于 matlabgui的音效处理器

基于 matlabgui的音效处理器

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:0.16M
  • 下载次数:8
  • 浏览次数:108
  • 发布时间:2019-04-10
  • 实例类别:一般编程问题
  • 发 布 人:crazycode
  • 文件格式:.zip
  • 所需积分:2
 相关标签: UI MATLAB 音效

实例介绍

【实例简介】

【实例截图】

from clipboard


【核心代码】

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

% Last Modified by GUIDE v2.5 12-Oct-2013 17:27:29

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @fenxi_OpeningFcn, ...
                   'gui_OutputFcn',  @fenxi_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 fenxi is made visible.
function fenxi_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 fenxi (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);




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


% --- Outputs from this function are returned to the command line.
function varargout = fenxi_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 luyin.
function luyin_Callback(hObject, eventdata, handles)
% hObject    handle to luyin (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
      set(handles.luyinpinlv,'Enable','on');
    set(handles.dakai,'Value',0);
    set(handles.luyinshijian,'Enable','on');
    set(handles.luyinqueding,'Enable','on');
    set(handles.dakaiqueding,'Enable','off');
     set(handles.bofang,'Value',0);
     set(handles.bofangpinlv,'Enable','off');
     set(handles.bofangqueding,'Enable','off');
     set(handles.luyinqueding,'string','开始');
    
else
end;

% Hint: get(hObject,'Value') returns toggle state of luyin


% --- Executes on button press in dakai.
function dakai_Callback(hObject, eventdata, handles)
% hObject    handle to dakai (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    set(handles.luyin,'Value',0);
    set(handles.luyinshijian,'Enable','off');
    set(handles.luyinqueding,'Enable','off');
    set(handles.dakaiqueding,'Enable','on');
    set(handles.bofang,'Value',0);
     set(handles.bofangpinlv,'Enable','off');
     set(handles.bofangqueding,'Enable','off');
       set(handles.luyinpinlv,'Enable','off');
else
end;
% Hint: get(hObject,'Value') returns toggle state of dakai


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

% Hint: get(hObject,'Value') returns toggle state of radiobutton3


% --- Executes on button press in luyinqueding.
function luyinqueding_Callback(hObject, eventdata, handles)
% hObject    handle to luyinqueding (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(hObject,'string','录音中');
pause(0.4);
Fs=str2double(get(handles.luyinpinlv,'String'));
t=str2double(get(handles.luyinshijian,'String'));
ai=analoginput('winsound',0);%初始化录音麦克
chanel=addchannel(ai,1);%1表示单声道
set(ai,'SampleRate',Fs); 
duration=t; %录音时间
set(ai,'SamplesPerTrigger',duration*Fs);
start(ai); 
y=0;time=0;
[y,time]=getdata(ai);%读出相应的数据
handles.y=y;
handles.Fs=Fs;
guidata(hObject,handles);
plot(handles.huitu,time,handles.y)%画出声音波形
title(handles.huitu,'时域图');
%ysize=size(handles.y);
set(hObject,'string','完毕');
set(handles.baocun,'Enable','on');
% --- Executes on button press in dakaiqueding.
function dakaiqueding_Callback(hObject, eventdata, handles)
% hObject    handle to dakaiqueding (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 [filename pathname]=uigetfile({'*.wav','ALL FILES(*.*)'},'选择声音文件');
if isequal([filename pathname],[0,0])
    return;
end
str=[pathname filename];%选择的声音文件路径和文件名
[temp Fs]=wavread(str);%temp表示声音数据 Fs表示频率
handles.y=temp;handles.Fs=Fs;
guidata(hObject,handles);
 N=length(handles.y);
f1=0:1/Fs:(N-1)/Fs;
plot(handles.huitu,f1,handles.y)%画出声音波形
title(handles.huitu,'时域图');
xlabel(handles.huitu,'时间/s');
ylabel(handles.huitu,'幅度');

set(handles.baocun,'Enable','on'); 
 set(handles.bofang,'Enable','on');
% --- 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)



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


% --- Executes during object creation, after setting all properties.
function luyinshijian_CreateFcn(hObject, eventdata, handles)
% hObject    handle to luyinshijian (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 bofang.
function bofang_Callback(hObject, eventdata, handles)
% hObject    handle to bofang (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if get(hObject,'Value')
    set(handles.luyin,'Value',0);
    set(handles.luyinshijian,'Enable','off');
    set(handles.luyinqueding,'Enable','off');
    set(handles.dakaiqueding,'Enable','off');
    set(handles.dakai,'Value',0);
     set(handles.bofangpinlv,'Enable','on');
     set(handles.bofangqueding,'Enable','on');
       set(handles.luyinpinlv,'Enable','off');
else
end;
% Hint: get(hObject,'Value') returns toggle state of bofang



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


% --- Executes during object creation, after setting all properties.
function bofangpinlv_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bofangpinlv (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 bofangqueding.
function bofangqueding_Callback(hObject, eventdata, handles)
% hObject    handle to bofangqueding (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
c=handles.Fs;
Fs=handles.Fs;
d=handles.y;
yy=handles.y;
contents = cellstr(get(handles.bofangpinlv,'String')) ;%获取listbox1中的细胞矩阵
bj=contents{get(handles.bofangpinlv,'Value')};%获取listbox中的值
if strcmp(bj,'音效')
    Fs=c;
    
elseif strcmp(bj,'快播')
    Fs=1.5*c;
    
elseif strcmp(bj,'倒放')
   yy = flipud(d); 
   
elseif strcmp(bj,'回音')
 % for i=1:length(handles.y) yy(i)=d(length(handles.y)-i 1); end
a=[zeros(5000,1);d;zeros(5000,1)];%声音延时
e=[zeros(10000,1);d];
b=[d;zeros(10000,1)];%使原声音长度与延时后相等  
yy=(a e)*0.6 b;
 
elseif strcmp(bj,'双声道左右穿行')
   for i=1:length(handles.y) yy(i,1)=d(i)*i/162000.0; end
    for i=1:length(handles.y) yy(i,2)=d(i)*(length(handles.y)-i)/162000.0; end
    %for i=1:length(handles.y) yy(i)=d(length(handles.y)-i 1); end
   % Fs=0.5*c;
elseif strcmp(bj,'机器人声')
n1 = 441;
n2 = n1;
WLen= 1024;
w1= hanning(WLen);
w2  = w1;
DAFx_in=d;
FS=Fs;
L= length(DAFx_in);
DAFx_in= [zeros(WLen, 1); DAFx_in; zeros(WLen-mod(L,n1),1)] / max(abs(DAFx_in));
DAFx_out=[zeros(length(DAFx_in),1)];
pin=0;
pout = 0;
pend = length(DAFx_in)-WLen;
while pin<pend
    grain = DAFx_in(pin 1:pin WLen).* w1;
    f= fft(grain);
    r= abs(f);
    grain = fftshift(real(ifft(r))).*w2;

    DAFx_out(pout 1:pout WLen) = DAFx_out(pout 1:pout WLen) grain;
    pin= pin   n1;
    pout= pout   n2;
end
DAFx_out = DAFx_out(WLen 1:WLen L) / max(abs(DAFx_out));
yy=  DAFx_out;
    
elseif strcmp(bj,'男女变声')
Fs=1.5*c;
end;
    wavplay(yy,Fs);
   %; 162422, num2str(n)
    y=fft(yy,length(yy));
   % ysize=size(y);检测他的维度
   % plot(handles.huitu2,abs(y));原来的
    [m,n]=size(d);N=length(yy);
    f1=0:Fs/N:Fs*(N-1)/N;
    plot(handles.huitu2,f1(1:N/80),y(1:N/80));%f1(1:N/80),y(1:N/80)
    xlabel(handles.huitu2,'频率/Hz');
    ylabel(handles.huitu2,'幅度');
     title(handles.huitu2,'频率特性');
     
f1=0:1/Fs:(N-1)/Fs;
plot(handles.huitu,f1,yy)%画出声音波形
title(handles.huitu,'时域图');
xlabel(handles.huitu,'时间/s');
ylabel(handles.huitu,'幅度');
   
grid on;


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


% --- Executes during object creation, after setting all properties.
function luyinpinlv_CreateFcn(hObject, eventdata, handles)
% hObject    handle to luyinpinlv (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 xianshi_Callback(hObject, eventdata, handles)
% hObject    handle to xianshi (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 xianshi as text
%        str2double(get(hObject,'String')) returns contents of xianshi as a double


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

Fs=handles.Fs;
     [filename]=uiputfile({'*.wav'},'文件保存');
wavwrite(handles.y,Fs,filename);%data表示声音数据






function b2g_Callback(hObject, eventdata, handles)
% hObject    handle to b2g_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
      %读取音频信息(双声道,16位,频率44100Hz)
      % 定义常数
    FL = 80;                % 帧长
    WL = 240;               % 窗长
    P = 10;                 % 预测系数个数
    data=handles.y;fs=handles.Fs;     % 载入语音数据
        data= data/max(data);        %归一化
    L = length(data);          % 读入语音长度
    FN = floor(L/FL)-2;     % 计算帧数
    
        % 预测和重建滤波器
    exc = zeros(L,1);       % 激励信号(预测误差)
    zi_pre = zeros(P,1);    % 预测滤波器的状态
    s_rec = zeros(L,1);     % 重建语音
    zi_rec = zeros(P,1);
    
        % 合成滤波器
    exc_syn = zeros(L,1);   % 合成的激励信号(脉冲串)
    s_syn = zeros(L,1);     % 合成语音
        last_syn = 0;   %存储上一个(或多个)段的最后一个脉冲的下标
        zi_syn = zeros(P,1);   % 合成滤波器的状态
    
        % 变调不变速滤波器
    exc_syn_t = zeros(L,1);   % 合成的激励信号(脉冲串)
    s_syn_t = zeros(L,1);     % 合成语音
        last_syn_t = 0;   %存储上一个(或多个)段的最后一个脉冲的下标
        zi_syn_t = zeros(P,1);   % 合成滤波器的状态
    
        % 变速不变调滤波器(假设速度减慢一倍)
        
    hw = hamming(WL);       % 汉明窗
    
    % 依次处理每帧语音
    for n = 3:FN

        % 计算预测系数(不需要掌握)
        s_w = data(n*FL-WL 1:n*FL).*hw;    %汉明窗加权后的语音
        [A E] = lpc(s_w, P);            %用线性预测法计算P个预测系数
                                        % A是预测系数,E会被用来计算合成激励的能量

      
        
        s_f = data((n-1)*FL 1:n*FL);       % 本帧语音,下面就要对它做处理

        % (4) 用filter函数s_f计算激励,注意保持滤波器状态
                [exc1,zi_pre] = filter(A,1,s_f,zi_pre);
        
        exc((n-1)*FL 1:n*FL) = exc1; %计算得到的激励

        % (5) 用filter函数和exc重建语音,注意保持滤波器状态
                [s_rec1,zi_rec] = filter(1,A,exc1,zi_rec);
        
        s_rec((n-1)*FL 1:n*FL) = s_rec1; %计算得到的重建语音

        % 注意下面只有在得到exc后才会计算正确
        s_Pitch = exc(n*FL-222:n*FL);
        PT = findpitch(s_Pitch);    % 计算基音周期PT(不要求掌握)
        G = sqrt(E*PT);           % 计算合成激励的能量G(不要求掌握)

                        
                %方法3:本段激励只能修改本段长度
                tempn_syn = [1:n*FL-last_syn]';
                exc_syn1 = zeros(length(tempn_syn),1);
                exc_syn1(mod(tempn_syn,PT)==0) = G; %某一段算出的脉冲
                exc_syn1 = exc_syn1((n-1)*FL-last_syn 1:n*FL-last_syn);
                [s_syn1,zi_syn] = filter(1,A,exc_syn1,zi_syn);
                exc_syn((n-1)*FL 1:n*FL) =  exc_syn1;   %计算得到的合成激励
                s_syn((n-1)*FL 1:n*FL) = s_syn1;   %计算得到的合成语音
                last_syn = last_syn PT*floor((n*FL-last_syn)/PT);
                 
       
        
        % (13) 将基音周期减小一半,将共振峰频率增加150Hz,重新合成语音,听听是啥感受~
                PT1 =floor(PT/2);   %减小基音周期
        poles = roots(A);
                deltaOMG =150*2*pi/fs;
                for p=1:10   %增加共振峰频率,实轴上方的极点逆时针转,下方顺时针转
                        if imag(poles(p))>0 poles(p) = poles(p)*exp(j*deltaOMG);
                        elseif imag(poles(p))<0 poles(p) = poles(p)*exp(-j*deltaOMG);
                        end
                end
                A1=poly(poles);
        
                
                tempn_syn_t = [1:n*FL-last_syn_t]';
                exc_syn1_t = zeros(length(tempn_syn_t),1);
                exc_syn1_t(mod(tempn_syn_t,PT1)==0) = G; %某一段算出的脉冲
                exc_syn1_t = exc_syn1_t((n-1)*FL-last_syn_t 1:n*FL-last_syn_t);
                [s_syn1_t,zi_syn_t] = filter(1,A1,exc_syn1_t,zi_syn_t);
                exc_syn_t((n-1)*FL 1:n*FL) =  exc_syn1_t;   %计算得到的合成激励
                s_syn_t((n-1)*FL 1:n*FL) = s_syn1_t;   %计算得到的合成语音
                last_syn_t = last_syn_t PT1*floor((n*FL-last_syn_t)/PT1);
        
    end

     plot(handles.axes3,s_syn_t),
     set(handles.axes3,'Xgrid','on');
     set(handles.axes3,'Ygrid','on');
     xlabel(handles.axes3,'数据序列');
     ylabel(handles.axes3,'频率');
     title(handles.axes3,'变音后的时域图'),XLim([0,length(s_syn_t)]);        
     handles.y=s_syn_t;
     guidata(hObject,handles);
     Fs=handles.foriginal;  
     N=length(handles.y);
    y1=fft(handles.y,N);
    f1=0:Fs/N:Fs*(N-1)/N;
    plot(handles.axes1,f1,handles.yoriginal);
    title(handles.axes1,'原始时域图');
    xlabel(handles.axes1,'时间');
    ylabel(handles.axes1,'频率');
    set(handles.axes1,'Xgrid','on');
    set(handles.axes1,'Ygrid','on');
   
    
    plot(handles.axes2,f1(1:N/2),y1(1:N/2));
    set(handles.axes2,'Xgrid','on');
    set(handles.axes2,'Ygrid','on');
    title(handles.axes2,'频谱图');
    xlabel( handles.axes2,'频率');
    ylabel( handles.axes2,'幅度');
   pause(3);
        sound(handles.yoriginal);

   sound(handles.y);

  
  
   

% --- Executes on button press in g2b_pushbutton.
function g2b_Callback(hObject, eventdata, handles)
% hObject    handle to g2b_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 y=handles.y;
 fs=handles.Fs;%读取音频信息(双声道,16位,频率44100Hz)
N=length(y)
f=0:fs/N:fs*(N-1)/N;
Y=fft(y,N);                %进行傅立叶变换
plot(handles.axes2,f(1:N/2),Y(1:N/2));
title(handles.axes2,'声音信号的频谱');
xlabel(handles.axes2,'频率');
ylabel(handles.axes2,'振幅');
f1=0:(fs*0.7)/N:(fs*0.7)*(N-1)/N;
syms t;
t=[0,9];
R=y*exp(2*pi*300*t);
P=fft(R,N);
Z=ifft(P);
z=real(Z);
handles.y=y;
plot(handles.axes3,f1(1:N/2),Z(1:N/2));
title(handles.axes3,'变声后的时域图');
xlabel(handles.axes3,'时间序列');
ylabel(handles.axes3,'频率')
set(handles.axes3,'Xgrid','on');
set(handles.axes3,'Ygrid','on');

 Fs=handles.foriginal;  
     N=length(handles.y);
    y1=fft(handles.y,N);
    f1=0:Fs/N:Fs*(N-1)/N;
    plot(handles.axes1,f1,handles.yoriginal);
    title(handles.axes1,'原始时域图');
    xlabel(handles.axes1,'时间');
    ylabel(handles.axes1,'频率');
    set(handles.axes1,'Xgrid','on');
    set(handles.axes1,'Ygrid','on');
   
    
    plot(handles.axes2,f1(1:N/2),y1(1:N/2));
    set(handles.axes2,'Xgrid','on');
    set(handles.axes2,'Ygrid','on');
    title(handles.axes2,'频谱图');
    xlabel( handles.axes2,'频率');
    ylabel( handles.axes2,'幅度');
   pause(3);
guidata(hObject,handles);

sound(handles.yoriginal);

sound(handles.y,handles.foriginal*0.7);

% --- Executes on button press in bijiao_pushbutton.
function bijiao_pushbutton_Callback(hObject, eventdata, handles)
% hObject    handle to bijiao_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
handles.y=handles.yoriginal;
handles.Fs=handles.foriginal;
guidata(hObject,handles);




% 计算一段语音的基音周期
function PT = findpitch(s)
[B, A] = butter(5, 700/4000);
s = filter(B,A,s);
R = zeros(143,1);
for k=1:143
    R(k) = s(144:223)'*s(144-k:223-k);
end
[R1,T1] = max(R(80:143));
T1 = T1   79;
R1 = R1/(norm(s(144-T1:223-T1)) 1);
[R2,T2] = max(R(40:79));
T2 = T2   39;
R2 = R2/(norm(s(144-T2:223-T2)) 1);
[R3,T3] = max(R(20:39));
T3 = T3   19;
R3 = R3/(norm(s(144-T3:223-T3)) 1);
Top = T1;
Rop = R1;
if R2 >= 0.85*Rop
    Rop = R2;
    Top = T2;
end
if R3 > 0.85*Rop
    Rop = R3;
    Top = T3;
end
PT = Top;
return


% --- Executes on key press with focus on bofangpinlv and none of its controls.
function bofangpinlv_KeyPressFcn(hObject, eventdata, handles)
% hObject    handle to bofangpinlv (see GCBO)
% eventdata  structure with the following fields (see UICONTROL)
%	Key: name of the key that was pressed, in lower case
%	Character: character interpretation of the key(s) that was pressed
%	Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles    structure with handles and user data (see GUIDATA)


% --- Executes during object creation, after setting all properties.
function axes4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: place code in OpeningFcn to populate axes4

标签: UI MATLAB 音效

实例下载地址

基于 matlabgui的音效处理器

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警