77范文网 - 专业文章范例文档资料分享平台

数字信号处理实验8音频频谱分析仪设计与实现(2)

来源:网络收集 时间:2019-04-05 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

程序:

function varargout = yinpin(varargin) % YINPIN M-file for yinpin.fig

% YINPIN, by itself, creates a new YINPIN or raises the existing % singleton*. %

% H = YINPIN returns the handle to a new YINPIN or the handle to % the existing singleton*. %

% YINPIN('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in YINPIN.M with the given input arguments. %

% YINPIN('Property','Value',...) creates a new YINPIN or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before yinpin_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to yinpin_OpeningFcn via varargin. %

% *See GUI Options on GUIDE's Tools menu. Choose \ % instance to run (singleton)\ %

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help yinpin

% Last Modified by GUIDE v2.5 07-Nov-2012 17:08:53

% Begin initialization code - DO NOT EDIT gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @yinpin_OpeningFcn, ... 'gui_OutputFcn', @yinpin_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 yinpin is made visible.

function yinpin_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 yinpin (see VARARGIN)

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

5 / 21

% Update handles structure guidata(hObject, handles);

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

% --- Outputs from this function are returned to the command line. function varargout = yinpin_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 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 during object creation, after setting all properties. function caiyangpinlv_CreateFcn(hObject, eventdata, handles) % hObject handle to caiyangpinlv (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 during object creation, after setting all properties. function caiyangdianshu_CreateFcn(hObject, eventdata, handles) % hObject handle to caiyangdianshu (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 luyin.

function luyin_Callback(hObject, eventdata, handles) % hObject handle to luyin (see GCBO)

6 / 21

% 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 luyin set(handles.luyin,'value',1); set(handles.wavfile,'value',0);

set(handles.xinhaofasheng,'value',0); h=findobj('Tag','recordtime'); set(h,'enable','on');

h=findobj('Tag','kaishiluyin'); set(h,'enable','on');

h=findobj('Tag','wavname'); set(h,'enable','off');

h=findobj('Tag','liulan'); set(h,'enable','off');

h=findobj('Tag','inwave'); set(h,'enable','off');

h=findobj('Tag','infudu'); set(h,'enable','off'); h=findobj('Tag','infre'); set(h,'enable','off');

h=findobj('Tag','inphase'); set(h,'enable','off'); h=findobj('Tag','mix'); set(h,'enable','off');

h=findobj('Tag','shengchengboxing'); set(h,'enable','off');

% --- Executes on button press in wavfile.

function wavfile_Callback(hObject, eventdata, handles) % hObject handle to wavfile (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 wavfile set(handles.luyin,'value',0); set(handles.wavfile,'value',1);

set(handles.xinhaofasheng,'value',0); h=findobj('Tag','recordtime'); set(h,'enable','off');

h=findobj('Tag','kaishiluyin'); set(h,'enable','off');

h=findobj('Tag','wavname'); set(h,'enable','on');

h=findobj('Tag','liulan'); set(h,'enable','on');

h=findobj('Tag','inwave'); set(h,'enable','off');

h=findobj('Tag','infudu'); set(h,'enable','off'); h=findobj('Tag','infre'); set(h,'enable','off');

h=findobj('Tag','inphase'); set(h,'enable','off'); h=findobj('Tag','mix'); set(h,'enable','off');

7 / 21

h=findobj('Tag','shengchengboxing'); set(h,'enable','off');

% --- Executes on button press in xinhaofasheng.

function xinhaofasheng_Callback(hObject, eventdata, handles) % hObject handle to xinhaofasheng (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 xinhaofasheng set(handles.luyin,'value',0); set(handles.wavfile,'value',0);

set(handles.xinhaofasheng,'value',1); h=findobj('Tag','recordtime'); set(h,'enable','off');

h=findobj('Tag','kaishiluyin'); set(h,'enable','off');

h=findobj('Tag','wavname'); set(h,'enable','off');

h=findobj('Tag','liulan'); set(h,'enable','off');

h=findobj('Tag','inwave'); set(h,'enable','on');

h=findobj('Tag','infudu'); set(h,'enable','on'); h=findobj('Tag','infre'); set(h,'enable','on');

h=findobj('Tag','inphase'); set(h,'enable','on'); h=findobj('Tag','mix'); set(h,'enable','on');

h=findobj('Tag','shengchengboxing'); set(h,'enable','on');

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

function kaishiluyin_Callback(hObject, eventdata, handles) % hObject handle to kaishiluyin (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 kaishiluyin Fs=str2double(get(handles.caiyangpinlv,'String')); N=str2double(get(handles.recordtime,'String'))*Fs; handles.y=wavrecord(N, Fs,'double'); handles.inputtype=1;

8 / 21

guidata(hObject,handles);

plot(handles.fenxiduixiang,handles.y); ysize=size(handles.y);

set(handles.caiyangdianshu,'String',num2str(ysize(1)));

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

function liulan_Callback(hObject, eventdata, handles) % hObject handle to liulan (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 liulan [filename,filepath]=uigetfile('*.wav','wavfile'); set(handles.wavname,'string',filename); [handles.y,Fs,bit]=wavread(filename); handles.inputtype=2; guidata(hObject,handles);

plot(handles.fenxiduixiang,(1:length(handles.y)/10)/Fs,handles.y(1:length(handles.y)/10)); ysize=size(handles.y);

set(handles.caiyangdianshu,'String',num2str(ysize(1))); set(handles.caiyangpinlv,'string',Fs);

% --- Executes during object creation, after setting all properties. function listbox2_CreateFcn(hObject, eventdata, handles) % hObject handle to listbox2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: listbox 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 during object creation, after setting all properties. function inwave_CreateFcn(hObject, eventdata, handles) % hObject handle to inwave (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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

9 / 21

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库数字信号处理实验8音频频谱分析仪设计与实现(2)在线全文阅读。

数字信号处理实验8音频频谱分析仪设计与实现(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/572990.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: