【正文】
eventdata, handles) % hObject handle to foutfreq (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。,39。defaultUicontrolBackgroundColor39。 isequal(get(hObject,39。)。 N=str2double(get(findobj(39。No wave exist! Please choose a input type!39。))。 return。 ymax=0。 if (==1||==2||==4) set(,39。非周期39。 end set(,39。String39。 %s set(,39。 set(,39。 set(,39。)。 N=str2double(get(findobj(39。No wave exist! Please choose a input type!39。))。非周期39。String39。 plot(,f,real(Y))。)。freqency(Hz)39。 ylabel(,39。)。由于本次試驗(yàn)學(xué)時(shí)有限,自身知識(shí)所限,沒(méi)有來(lái)得及實(shí)現(xiàn)。對(duì)于非周期的信號(hào),會(huì)顯示“非周期”。 ylabel(,39。phase(rad)39。)。 xlabel(,39。 plot(,f,2*sqrt(Y.*conj(Y)))。)。String39。 to=str2double(get(,39。))。String39。 h=waitbar(0,39。 plot(,(1:length())/Fs,)。wavfile39。String39。,num2str(mean(phase)))。String39。String39。 %freqence and periodicity for i=1:n1 T(i)=ti(i+1)ti(i)。 else ti(n)=(i)/((i)(i1))。Error range!39。 from=str2double(get(,39。))。String39。,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 amp。BackgroundColor39。)) set(hObject,39。white39。amp。), get(0,39。BackgroundColor39。)。 isequal(get(hObject,39。defaultUicontrolBackgroundColor39。,39。 end function outphase_CreateF(hObject, eventdata, handles) if ispc amp。BackgroundColor39。)) set(hObject,39。white39。amp。), get(0,39。BackgroundColor39。)。 isequal(get(hObject,39。defaultUicontrolBackgroundColor39。,39。 end function edit13_CreateF(hObject, eventdata, handles) if ispc amp。BackgroundColor39。)) set(hObject,39。white39。amp。WAVE39。 =4。 =3。))。String39。),39。BackgroundColor39。)。 isequal(get(hObject,39。defaultUicontrolBackgroundColor39。,39。 end function inwave_CreateF(hObject, eventdata, handles) if ispc amp。BackgroundColor39。String39。string39。white39。amp。 =1。String39。), get(0,39。enable39。on39。 h=findobj(39。,39。)。enable39。on39。 h=findobj(39。,39。)。enable39。off39。 h=findobj(39。value39。shengchengboxing39。 set(h,39。,39。)。Tag39。infudu39。 set(h,39。,39。)。Tag39。kaishiluyin39。 set(h,39。 set(,39。off39。 h=findobj(39。,39。)。enable39。off39。 h=findobj(39。,39。)。enable39。on39。 h=findobj(39。,39。 set(,39。)) set(hObject,39。white39。amp。), get(0,39。 else gui_mainf(gui_State, varargin{:})。gui_LayoutF39。gui_Name39。CALLBACK39。以頻率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),可以得到虛頻譜。Y可按下式計(jì)算式中,N為樣本容量,Δt = 1/Fs為采樣間隔。(3)相位檢測(cè)采用過(guò)零法,即通過(guò)判斷與同頻零相位信號(hào)過(guò)零點(diǎn)時(shí)刻,計(jì)算其時(shí)間差,然后換成相應(yīng)的相位差。本實(shí)驗(yàn)可以用MATLAB進(jìn)行音頻信號(hào)頻譜分析儀的設(shè)計(jì)與實(shí)現(xiàn)。其中tin表示第n個(gè)過(guò)零點(diǎn),yi為第i個(gè)采樣點(diǎn)的值,F(xiàn)s為采樣頻率。其原理即是將重復(fù)的三角函數(shù)算計(jì)的中間結(jié)果保存起來(lái),以減少重復(fù)三角函數(shù)計(jì)算帶來(lái)的時(shí)間浪費(fèi)。根據(jù)人類(lèi)解決一般問(wèn)題的經(jīng)驗(yàn),如果一個(gè)問(wèn)題由兩個(gè)問(wèn)題組合而成,那么它的復(fù)雜程度大于分別考慮每個(gè)問(wèn)題時(shí)的復(fù)雜程度之和,也就是說(shuō)把復(fù)雜的問(wèn)題分解成許多容易解決的小問(wèn)題,原來(lái)的問(wèn)題也就容易解決了。,39。, gui_Singleton, ... 39。, [])。 function varargout = yinpin_OutputF(hObject, eventdata, handles) varargout{1} = 。BackgroundColor39。), get(0,39。amp。white39。 set(,39。 set(h,39。kaishiluyin39。Tag39。)。,39。 set(h,39。infudu39。Tag39。)。,39。 set(h,39。shengchengboxing39。value39。 h=findobj(39。off39。enable39。)。,39。 h=findobj(39。off39。enable39。)。,39。 h=findobj(39。off39。enable39。value39。recordtime39。Tag39。)。,39。 set(h,39。inwave39。Tag39。)。,39。 set(h,39。mix39。Tag39。)。BackgroundColor39。String39。 ysize=size()。), get(0,39。*.wav39。 =2。string39。)) set(hObject,39。BackgroundColor39。 end function infudu_CreateF(hObject, eventdata, handles) if ispc amp。,39。defaultUicontrolBackgroundColor39。 isequal(get(hObject,39。)。 N=str2double(get(findobj(39。 soundtype=get(,39。))。 case 3 y=amp*sawtooth(2*pi*x*frequency+phase,)。)== =y。String39。), get(0,39。amp。white39。)) set(hObject,39。BackgroundColor39。 end function edit14_CreateF(hObject, eventdata, handles) if ispc amp。,3