SlideShare a Scribd company logo
1 of 19
Task is to design a 10-band software
audio equalizer.
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Open Matlab
 Using “ guide ” function create a new GUI
1/5/2017Audio Equalizer.............................................Hasham_Khan
 For 10 bands Audio Equalizer we need 10 sliders…
so select 10 sliders
1/5/2017Audio Equalizer.............................................Hasham_Khan
 After the completion of previous step your design will be like this ;
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Define the values for each slider handles
• global stop C Fs;
• stop=1;
• Fs=44100;
• C=zeros(1,10);
Slider 1 values are as follow;
• set(handles.slider1,'min',-20);
• set(handles.slider1,'max',20);
• set(handles.slider1,'value',0);
• set(handles. slider1,'SliderStep',[0.025,0.05]);
• set(handles. slider1,'string',num2str(0));
Repeat the above steps for all 10 Sliders
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Double click on each slider and click “ callback”
and “ CreateFtn ”…By clicking both you will see both functions
in your m file
1/5/2017Audio Equalizer.............................................Hasham_Khan
 To get the different values of slider add “get” function
• % Executes on slider movement.
• function slider1_Callback(hObject, eventdata, handles)
• global C;
• C(1)=get(hObject,'value');
• set(handles.slider1_val,'string',num2str(C(1)));
• % --- Executes during object creation, after setting all properties.
• function slider1_CreateFcn(hObject, eventdata, handles)
• if isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
• set(hObject,'BackgroundColor',[.9 .9 .9]);
• end
Repeat the above steps for all 10 sliders
1/5/2017Audio Equalizer.............................................Hasham_Khan
 To add “Load”, “ Reset ”, “ Play ” ,“ Stop ’’ buttons use the Push button
in the GUI
 Double click on Push button and change the string and tag as load , reset ,
play and stop.
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Now after adding the button your design will be like this ;
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Double click on each button and select callback function
For Reset button :
• set(handles.slider1_val,'string',num2str(0));
• set(handles.slider1_var,'value',0);
Repeat the above step for all 10 sliders
For Load button :
• % -Executes on button press in load.
• function load_Callback(hObject, eventdata, handles)
• global file_name;
• file_name=uigetfile('*wav','hasham .wav');
1/5/2017Audio Equalizer.............................................Hasham_Khan
For Stop and Play Button :
• % --- Executes on button press in play.
• function play_Callback(hObject,
eventdata, handles)
• global stop file_name C;
• stop=1;
• equalizer_play();
• function equalizer_play()
• global stop file_name C;
• [x,Fs]=wavread(file_name);
• [a,b]=coef();
• l_bucata=2*Fs;
• Nb=round(length(x)/l_bucata);
• y=0;
• for i=1:floor(Nb)
• bucata=x((i-1)*l_bucata+1:i*l_bucata);
• for k=1:5
• y=y+filter(10^(C(k)/20)*b{k},a{k},bucat
a);
• if(stop==0)
• break;
• end
• end
• wavplay(y,Fs,'async');
• y=0;
• if(stop==0)
• break;
• end
• end
• % --- Executes on button press in stop.
• function stop_Callback(hObject, eventdata,
handles)
• global stop;
• stop=0;
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Add Edit Text to each slider and double click the edit text icon and select
“callback” and “CreateFtn” for each slider
1/5/2017Audio Equalizer.............................................Hasham_Khan
 After adding the edit text to each slider your design will be like this ;
1/5/2017Audio Equalizer.............................................Hasham_Khan
 To have the value of each slider add the below code to each slider;
 function slider1_val_Callback(hObject, eventdata, handles)
 global C;
 C(1)=str2num(get(hObject,'string'));
 minn=get(handles.C1_var,'min');maxx=get(handles.C1_var,'max');
 if(C(1)<minn || C(1)>maxx)
 C(1)=get(handles.C1_var,'value');set(hObject,'string',num2str(0));
 else set(handles.slider1_var,'value',C(1));
 end
 function slider1_val_CreateFcn(hObject, eventdata, handles)
 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
 set(hObject,'BackgroundColor','black');
 end
Repeat the above step for all 10 sliders
1/5/2017Audio Equalizer.............................................Hasham_Khan
 Add equalizer plot and filter function in the code. As the equalizer is of
10 band so we have to design 10 filters.
1/5/2017Audio Equalizer.............................................Hasham_Khan
 After adding the equalizer plot your design will be like this ;
1/5/2017Audio Equalizer.............................................Hasham_Khan
 So your design of 10 Band Audio Equalizer is ready now run the code
1/5/2017Audio Equalizer.............................................Hasham_Khan
Thank You
Prepared by
Hasham Khan
hkhan.msee16seecs@seecs.edu.pk
NUST School of Electrical Engineering and Computer Science(SEECS)
1/5/2017Audio Equalizer.............................................Hasham_Khan

More Related Content

What's hot

What's hot (20)

Pre emphasis and de-emphasis
Pre emphasis and de-emphasisPre emphasis and de-emphasis
Pre emphasis and de-emphasis
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
 
ARM
ARMARM
ARM
 
Reliability and yield
Reliability and yield Reliability and yield
Reliability and yield
 
Sr jk flip flop by AMAN GOYAT
Sr jk flip flop by AMAN GOYATSr jk flip flop by AMAN GOYAT
Sr jk flip flop by AMAN GOYAT
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Charged pump plls
Charged pump pllsCharged pump plls
Charged pump plls
 
UVM Methodology Tutorial
UVM Methodology TutorialUVM Methodology Tutorial
UVM Methodology Tutorial
 
AMBA BUS.pptx
AMBA BUS.pptxAMBA BUS.pptx
AMBA BUS.pptx
 
FSM and ASM
FSM and ASMFSM and ASM
FSM and ASM
 
Stick digram by Euler Approach
Stick digram by Euler ApproachStick digram by Euler Approach
Stick digram by Euler Approach
 
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLDesigning of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDL
 
1.FPGA for dummies: Basic FPGA architecture
1.FPGA for dummies: Basic FPGA architecture 1.FPGA for dummies: Basic FPGA architecture
1.FPGA for dummies: Basic FPGA architecture
 
VLSI subsystem design processes
VLSI  subsystem design processes VLSI  subsystem design processes
VLSI subsystem design processes
 
System On Chip (SOC)
System On Chip (SOC)System On Chip (SOC)
System On Chip (SOC)
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
Angle Modulation
Angle ModulationAngle Modulation
Angle Modulation
 
SOC design
SOC design SOC design
SOC design
 
Embedded system
Embedded systemEmbedded system
Embedded system
 

Similar to Audio equalizer

Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with RubyKeith Pitty
 
Game programming workshop
Game programming workshopGame programming workshop
Game programming workshopnarigadu
 
Cheap Online Zyprexa Fedex Cod
Cheap Online Zyprexa Fedex Cod Cheap Online Zyprexa Fedex Cod
Cheap Online Zyprexa Fedex Cod TopMed
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212Mahmoud Samir Fayed
 
Chapter03 Of It .... BBa 1st
Chapter03 Of It .... BBa 1st Chapter03 Of It .... BBa 1st
Chapter03 Of It .... BBa 1st Geo-Info Ltd
 
Game salad creator for windows manual 2012 11-01
Game salad creator for windows manual 2012 11-01Game salad creator for windows manual 2012 11-01
Game salad creator for windows manual 2012 11-01gabikovacs10
 
The Ring programming language version 1.5.4 book - Part 18 of 185
The Ring programming language version 1.5.4 book - Part 18 of 185The Ring programming language version 1.5.4 book - Part 18 of 185
The Ring programming language version 1.5.4 book - Part 18 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 16 of 180
The Ring programming language version 1.5.1 book - Part 16 of 180The Ring programming language version 1.5.1 book - Part 16 of 180
The Ring programming language version 1.5.1 book - Part 16 of 180Mahmoud Samir Fayed
 
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.ppt
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.pptGRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.ppt
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.pptCherryLim21
 

Similar to Audio equalizer (20)

Automated Testing with Ruby
Automated Testing with RubyAutomated Testing with Ruby
Automated Testing with Ruby
 
Readme cakewalk
Readme cakewalkReadme cakewalk
Readme cakewalk
 
Game programming workshop
Game programming workshopGame programming workshop
Game programming workshop
 
Readme
ReadmeReadme
Readme
 
Readme
ReadmeReadme
Readme
 
Cheap Online Zyprexa Fedex Cod
Cheap Online Zyprexa Fedex Cod Cheap Online Zyprexa Fedex Cod
Cheap Online Zyprexa Fedex Cod
 
The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212The Ring programming language version 1.10 book - Part 92 of 212
The Ring programming language version 1.10 book - Part 92 of 212
 
Chapter03 Of It .... BBa 1st
Chapter03 Of It .... BBa 1st Chapter03 Of It .... BBa 1st
Chapter03 Of It .... BBa 1st
 
Game salad creator for windows manual 2012 11-01
Game salad creator for windows manual 2012 11-01Game salad creator for windows manual 2012 11-01
Game salad creator for windows manual 2012 11-01
 
PHP
PHPPHP
PHP
 
How To Theme Fedora
How To Theme FedoraHow To Theme Fedora
How To Theme Fedora
 
The Ring programming language version 1.5.4 book - Part 18 of 185
The Ring programming language version 1.5.4 book - Part 18 of 185The Ring programming language version 1.5.4 book - Part 18 of 185
The Ring programming language version 1.5.4 book - Part 18 of 185
 
Readme
ReadmeReadme
Readme
 
Readme
ReadmeReadme
Readme
 
The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88The Ring programming language version 1.3 book - Part 10 of 88
The Ring programming language version 1.3 book - Part 10 of 88
 
The Ring programming language version 1.5.1 book - Part 16 of 180
The Ring programming language version 1.5.1 book - Part 16 of 180The Ring programming language version 1.5.1 book - Part 16 of 180
The Ring programming language version 1.5.1 book - Part 16 of 180
 
Software and its types
Software and its typesSoftware and its types
Software and its types
 
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.ppt
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.pptGRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.ppt
GRADE 7 LESSON 3-4 HARDWARE N SOFTWARE.ppt
 
IBM Ported Tools for z/OS: OpenSSH User's Guide
IBM Ported Tools for z/OS: OpenSSH User's GuideIBM Ported Tools for z/OS: OpenSSH User's Guide
IBM Ported Tools for z/OS: OpenSSH User's Guide
 
Readme
ReadmeReadme
Readme
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsmeharikiros2
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessorAshwiniTodkar4
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...ssuserdfc773
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 

Recently uploaded (20)

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Query optimization and processing for advanced database systems
Query optimization and processing for advanced database systemsQuery optimization and processing for advanced database systems
Query optimization and processing for advanced database systems
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 

Audio equalizer

  • 1.
  • 2. Task is to design a 10-band software audio equalizer. 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 3.  Open Matlab  Using “ guide ” function create a new GUI 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 4.  For 10 bands Audio Equalizer we need 10 sliders… so select 10 sliders 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 5.  After the completion of previous step your design will be like this ; 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 6.  Define the values for each slider handles • global stop C Fs; • stop=1; • Fs=44100; • C=zeros(1,10); Slider 1 values are as follow; • set(handles.slider1,'min',-20); • set(handles.slider1,'max',20); • set(handles.slider1,'value',0); • set(handles. slider1,'SliderStep',[0.025,0.05]); • set(handles. slider1,'string',num2str(0)); Repeat the above steps for all 10 Sliders 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 7.  Double click on each slider and click “ callback” and “ CreateFtn ”…By clicking both you will see both functions in your m file 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 8.  To get the different values of slider add “get” function • % Executes on slider movement. • function slider1_Callback(hObject, eventdata, handles) • global C; • C(1)=get(hObject,'value'); • set(handles.slider1_val,'string',num2str(C(1))); • % --- Executes during object creation, after setting all properties. • function slider1_CreateFcn(hObject, eventdata, handles) • if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) • set(hObject,'BackgroundColor',[.9 .9 .9]); • end Repeat the above steps for all 10 sliders 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 9.  To add “Load”, “ Reset ”, “ Play ” ,“ Stop ’’ buttons use the Push button in the GUI  Double click on Push button and change the string and tag as load , reset , play and stop. 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 10.  Now after adding the button your design will be like this ; 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 11.  Double click on each button and select callback function For Reset button : • set(handles.slider1_val,'string',num2str(0)); • set(handles.slider1_var,'value',0); Repeat the above step for all 10 sliders For Load button : • % -Executes on button press in load. • function load_Callback(hObject, eventdata, handles) • global file_name; • file_name=uigetfile('*wav','hasham .wav'); 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 12. For Stop and Play Button : • % --- Executes on button press in play. • function play_Callback(hObject, eventdata, handles) • global stop file_name C; • stop=1; • equalizer_play(); • function equalizer_play() • global stop file_name C; • [x,Fs]=wavread(file_name); • [a,b]=coef(); • l_bucata=2*Fs; • Nb=round(length(x)/l_bucata); • y=0; • for i=1:floor(Nb) • bucata=x((i-1)*l_bucata+1:i*l_bucata); • for k=1:5 • y=y+filter(10^(C(k)/20)*b{k},a{k},bucat a); • if(stop==0) • break; • end • end • wavplay(y,Fs,'async'); • y=0; • if(stop==0) • break; • end • end • % --- Executes on button press in stop. • function stop_Callback(hObject, eventdata, handles) • global stop; • stop=0; 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 13.  Add Edit Text to each slider and double click the edit text icon and select “callback” and “CreateFtn” for each slider 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 14.  After adding the edit text to each slider your design will be like this ; 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 15.  To have the value of each slider add the below code to each slider;  function slider1_val_Callback(hObject, eventdata, handles)  global C;  C(1)=str2num(get(hObject,'string'));  minn=get(handles.C1_var,'min');maxx=get(handles.C1_var,'max');  if(C(1)<minn || C(1)>maxx)  C(1)=get(handles.C1_var,'value');set(hObject,'string',num2str(0));  else set(handles.slider1_var,'value',C(1));  end  function slider1_val_CreateFcn(hObject, eventdata, handles)  if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))  set(hObject,'BackgroundColor','black');  end Repeat the above step for all 10 sliders 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 16.  Add equalizer plot and filter function in the code. As the equalizer is of 10 band so we have to design 10 filters. 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 17.  After adding the equalizer plot your design will be like this ; 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 18.  So your design of 10 Band Audio Equalizer is ready now run the code 1/5/2017Audio Equalizer.............................................Hasham_Khan
  • 19. Thank You Prepared by Hasham Khan hkhan.msee16seecs@seecs.edu.pk NUST School of Electrical Engineering and Computer Science(SEECS) 1/5/2017Audio Equalizer.............................................Hasham_Khan