资源简介
本文的设计均衡器以MATLAB为开发平台,利用MATLAB的GUI功能,能实现对音乐的读取,播放,音量调节,分段频率调节,以及波形显示等功能,对数字信号处理有极好的演示。
代码片段和文件信息
function varargout = Equalizer(varargin)
% Equalizer M-file for Equalizer.fig
% Equalizer by itself creates a new Equalizer or raises the existing
% singleton*.
%
% H = Equalizer returns the handle to a new Equalizer or the handle to
% the existing singleton*.
%
% Equalizer(‘CALLBACK‘hobjecteventDatahandles...) calls the local
% function named CALLBACK in Equalizer.M with the given input arguments.
%
% Equalizer(‘Property‘‘Value‘...) creates a new Equalizer or raises the
% existing singleton*. Starting from the left property value pairs are
% applied to the GUI before Equalizer_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Equalizer_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE‘s Tools menu. Choose “GUI allows only one
% instance to run (singleton)“.
%
% See also: GUIDE GUIDATA GUIHANDLES
% Edit the above text to modify the response to help Equalizer
% Last Modified by GUIDE v2.5 09-Jan-2014 08:38:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘ mfilename ...
‘gui_Singleton‘ gui_Singleton ...
‘gui_OpeningFcn‘ @Equalizer_OpeningFcn ...
‘gui_OutputFcn‘ @Equalizer_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
function varargout = Equalizer_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;
function button_Open_Callback(hobject eventdata handles)
stop(handles.timer1);
global n i stp x y fs C w fpath i N step w1 w2 w3 w4 w5 a b;
n=1;i=1;
[filename pathname] = uigetfile({‘*.wav‘ ‘All Image Files (*.wav)‘;‘*.*‘‘All Files (*.*)‘}‘Pick a wave‘);
if isequal(filename0)||isequal(pathname0)
return;
end
fpath=[pathname filename];
[yFs]=wavread(fpath);
Max=length(y);
if Fs==44100
y=y(1:4:Max);
end
w1=filter(10^(C(1)/20)*b{1}a{1}y);
w2=filter(10^(C(2)/20)*b{2}a{2}y);
w3=filter(10^(C(3)/20)*b{3}a{3}y);
w4=filter(10^(C(4)/20)*b{4}a{4}y);
w5=filter(10^(C(5)/20)*b{5}a{5}y);
w=w1+w2+w3+w4+w5;
x=audioplayer(yfs);
stp=0;
setappdata(handles.figure_Equalizer‘Max‘Max);
setappdata(handles.figure_Equalizer‘fpath‘fpath);
set(handles.schedule_Sld‘max‘100);
str=ConvTime(fix(x.TotalSamples/fs));
set(handles.time_End‘string‘str);
step=fix(x.TotalSamples/fs/4);
Info= strcat(‘正在
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 15844 2014-01-09 21:39 Equalizer.fig
文件 27064 2014-01-09 21:39 Equalizer.m
相关资源
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
- matlab程序用Hopfield网络解决TSP
- 实例matlab 编程100个常用程序
- 用MATLAB(BPSK仿真 直接扩频)
评论
共有 条评论