⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soundbutton.m

📁 带功率谱展示和声音输出的交互的信号生成器的源代码。
💻 M
字号:
function SoundButton(n,h)
% Added in version 1.1
% Updates the value of soundmode and plays the signal vector y as a sound through the computer speakers
% Tom O'Haver, May 2007

global x
global y
global samplingtime
global samplerate
global f1
global f2
global signaltype
global signalstring
global soundmode

soundmode=round(n);
if soundmode==1,
    xlabel([ 'n= ' num2str(length(y)) '    Time = ' num2str(0.1*round(10*samplingtime)) '    Rate = ' num2str(round(samplerate)) '    F1 = ' num2str(0.1*round(10*f1))  '    F2= ' num2str(0.1*round(10*f2)) '   Sound ON'])
else
    xlabel([ 'n= ' num2str(length(y)) '    Time = ' num2str(0.1*round(10*samplingtime)) '    Rate = ' num2str(round(samplerate)) '    F1 = ' num2str(0.1*round(10*f1))  '    F2= ' num2str(0.1*round(10*f2)) '   Sound OFF'])
end
wavplay(y./2,samplerate)


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -