【正文】
nction varargout = yinpin(varargin) % YINPIN Mfile for % 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(39。, yinpin_OutputF, ... 39。BackgroundColor39。,39。,1)。)。 set(h,39。Tag39。,39。inphase39。)。,1)。,39。on39。)。 h=findobj(39。enable39。,39。,1)。 set(h,39。Tag39。,39。infre39。)。 set(h,39。 end function kaishiluyin_Callback(hObject, eventdata, handles) Fs=str2double(get(,39。 function wavname_CreateF(hObject, eventdata, handles) if ispc amp。 set(,39。 isequal(get(hObject,39。BackgroundColor39。amp。)) set(hObject,39。),39。 switch soundtype case 1 y=amp*sin(2*pi*x*frequency+phase)。 title(39。,39。 isequal(get(hObject,39。BackgroundColor39。amp。)) set(hObject,39。 end function circle_CreateF(hObject, eventdata, handles) if ispc amp。defaultUicontrolBackgroundColor39。)。), get(0,39。white39。BackgroundColor39。,39。 isequal(get(hObject,39。BackgroundColor39。String39。 msgbox(39。 end end end n=n1。 set(,39。 %meansquare set(,39。 guidata(hObject,handles)。),39。))。非周期39。)。 ylabel(,39。三種輸入方式間可以方便的切換,并且一次只能選擇一種輸入方式(選擇一種輸入方式后,其他輸入方式的功能鍵會(huì)變灰,將不能使用,除非再次選擇該輸入方式)。 音頻頻譜分析儀運(yùn)行結(jié)果1. 聲卡輸入聲卡輸入的錄音是非周期的,故時(shí)域分析和頻域分析結(jié)果都是“非周期”。)。 plot(,f,imag(Y))。)。)。 for i=1:10000 waitbar(i/10000,h) end close(h) % Executes on button press in freqanalyse. function freqanalyse_Callback(hObject, eventdata, handles) % hObject handle to freqanalyse (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) Fs=str2double(get(findobj(39。string39。,(max((from:to))min((from:to)))/2)。)。 ymin=0。 to=str2double(get(,39。Tag39。BackgroundColor39。white39。), get(0,39。)。defaultUicontrolBackgroundColor39。 end % Executes during object creation, after setting all properties. function outpeak_CreateF(hObject, eventdata, handles) % hObject handle to outpeak (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc amp。)) set(hObject,39。amp。BackgroundColor39。 isequal(get(hObject,39。,39。BackgroundColor39。white39。), get(0,39。)== =y。))。 N=str2double(get(findobj(39。 isequal(get(hObject,39。,39。BackgroundColor39。string39。*.wav39。 ysize=size()。BackgroundColor39。Tag39。 set(h,39。)。inwave39。,39。Tag39。value39。off39。,39。enable39。 h=findobj(39。)。off39。value39。 set(h,39。)。infudu39。,39。Tag39。 set(h,39。white39。), get(0,39。 function varargout = yinpin_OutputF(hObject, eventdata, handles) varargout{1} = 。, gui_Singleton, ... 39。根據(jù)人類解決一般問題的經(jīng)驗(yàn),如果一個(gè)問題由兩個(gè)問題組合而成,那么它的復(fù)雜程度大于分別考慮每個(gè)問題時(shí)的復(fù)雜程度之和,也就是說把復(fù)雜的問題分解成許多容易解決的小問題,原來的問題也就容易解決了。其中tin表示第n個(gè)過零點(diǎn),yi為第i個(gè)采樣點(diǎn)的值,F(xiàn)s為采樣頻率。(3)相位檢測采用過零法,即通過判斷與同頻零相位信號(hào)過零點(diǎn)時(shí)刻,計(jì)算其時(shí)間差,然后換成相應(yīng)的相位差。以頻率f為橫坐標(biāo),|Y(f)|為縱坐標(biāo),可以得到幅值譜;以頻率f為橫坐標(biāo),arg Y(f)為縱坐標(biāo),可以得到相位譜;以頻率f為橫坐標(biāo),Re Y(f)為縱坐標(biāo),可以得到實(shí)頻譜;以頻率f為橫坐標(biāo),Im Y(f)為縱坐標(biāo),可以得到虛頻譜。gui_Name39。 else gui_mainf(gui_State, varargin{:})。amp。)) set(hObject,39。,39。on39。)。 h=findobj(39。enable39。,39。off39。 set(h,39。Tag39。,39。infudu39。)。 set(h,39。value39。off39。)。 h=findobj(39。enable39。,39。on39。), get(0,39。 =1。white39。String39。 end function inwave_CreateF(hObject, eventdata, handles) if ispc amp。defaultUicontrolBackgroundColor39。)。),39。))。 =4。amp。)) set(hObject,39。 end function edit13_CreateF(hObject, eventdata, handles) if ispc amp。defaultUicontrolBackgroundColor39。)。), get(0,39。white39。BackgroundColor39。,39。 isequal(get(hObject,39。BackgroundColor39。amp。)) set(hObject,39。 end % Executes during object creation, after setting all properties. function pointto_CreateF(hObject, eventdata, handles) % hObject handle to pointto (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc