资源简介

本文的设计均衡器以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

评论

共有 条评论