资源简介
使用MATLAB和声卡录音,然后做FFT,绘制声音的波形图和频谱图
代码片段和文件信息
function record(op)
global H_RECORD F_RECORD AXIS_RECORD ai data z_data R_fs R_samp_len
global ZOOM_HISTORY
if nargin == 0 % if no input argument draw the GUI
op = 0;
end
%spec = ‘wideband‘;
spec = ‘narrowband‘;
wideband_time = 4e-3;
narrowband_time = 25e-3;
%window_width = 200; % window width for FFT
%step_size = 100; % window movement
fft_pts = 2048; % # of points in the FFT
switch op
case 0 % Draw figure
clear global data % erase any previously recorded data
width = 600;
height = 400;
% 图形界面总体的设置
F_RECORD = figure(‘numbertitle‘‘off‘...
‘position‘[120 120 600 400]...
‘name‘‘Record and Feature extraction‘...
‘color‘[0.8 0.8 0.8]...
‘MenuBar‘‘none‘);
hm_q=uimenu(F_RECORD‘label‘‘File‘);
uimenu(hm_q‘label‘‘O&pen‘‘callback‘‘kcdopen13_wav‘);
uimenu(hm_q‘label‘‘S&ave‘‘callback‘‘record(4)‘);
uimenu(hm_q‘label‘‘L&oad‘‘callback‘‘kcdloadfile‘);
uimenu(hm_q‘label‘‘Q&uit‘‘callback‘‘record(5);index2‘);
uimenu(hm_q‘label‘‘C&lose‘‘callback‘‘record(5)‘);
hm_qq=uimenu(F_RECORD‘label‘‘Record‘);
uimenu(hm_qq‘label‘‘Record‘‘callback‘[‘record(1)‘]);
hm_qqq=uimenu(F_RECORD‘label‘‘Play‘);
uimenu(hm_qqq‘label‘‘Play‘‘callback‘‘record(2)‘);
hm_qqqq=uimenu(F_RECORD‘label‘‘Feature‘);
uimenu(hm_qqqq‘label‘‘weveletⅠ‘‘callback‘‘recode(6)‘)
uimenu(hm_qqqq‘label‘‘weveletⅡ‘‘callback‘‘recode(7)‘);
uimenu(hm_qqqq‘label‘‘wevelet‘‘callback‘‘recode(8)‘);
hm_qqqqq=uimenu(F_RECORD‘label‘‘Help‘);
uimenu(hm_qqqqq‘label‘‘Help‘‘callback‘‘NNEditionInfo‘);
RECORD_axes1=axes(‘position‘[50/width (height-195)/height 500/width 120/height]);
RECORD_axes2=axes(‘position‘[50/width (height-355)/height 500/width 120/height]);
H_RECORD(1) = uicontrol(‘style‘‘text‘...
‘Units‘‘normalized‘ ...
‘Position‘[200/width (height-30)/height 180/width 20/height]...
‘BackgroundColor‘[.8 .8 .8]...
‘fontsize‘12...
‘String‘‘Welecom‘);
H_RECORD(2) = uicontrol(‘style‘‘text‘...
‘Units‘‘normalized‘ ...
‘Position‘[200/width (height-55)/height 180/width 20/height]...
‘BackgroundColor‘[.8 .8 .8]...
‘fontsize‘12...
‘String‘‘ ‘);
H_RECORD(4) = uicontrol(‘style‘‘Slider‘... % user selects time length
‘Units‘‘normalized‘ ...
‘Position‘[420/width (height-35)/height 100/width 14/height]...
‘Min‘0.1‘Max‘1‘Value‘1...
‘SliderStep‘[1/5-0.000001 1/5]...
‘Callback‘‘record(3)‘);
H_RECORD(5) = uicontrol(‘style‘‘text‘... % diplays time length
‘Units‘‘normalized‘ ...
‘Position‘[420/width (height-54)/height 100/width 14/height]...
‘BackgroundColor‘[.8 .8 .8]...
‘String‘‘Length - 1 sec‘);
uicontrol(F_RECORD‘style‘‘text‘‘u
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9517 2009-10-16 06:10 record.m
----------- --------- ---------- ----- ----
9517 1
- 上一篇:三相逆变器PWM仿真及报告
- 下一篇:matlab机械优化设计
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论