Professional Documents
Culture Documents
Audio Equalization
Audio Equalization
Reconstruct signal
components
Output waveform of
Original Audio and Applied
filter Audio
Matlab Code (App Designer Code)-
classdef tes < matlab.apps.AppBase
end
end
end
% Component initialization
methods (Access = private)
% Create Panel
app.Panel = uipanel(app.UIFigure);
app.Panel.Position = [31 632 596 77];
% Create FileAddressEditFieldLabel
app.FileAddressEditFieldLabel = uilabel(app.Panel);
app.FileAddressEditFieldLabel.HorizontalAlignment = 'right';
app.FileAddressEditFieldLabel.Position = [11 26 92 22];
app.FileAddressEditFieldLabel.Text = 'File Address';
% Create FileAddressEditField
app.FileAddressEditField = uieditfield(app.Panel, 'text');
app.FileAddressEditField.Position = [115 23 363 33];
% Create BrowseButton
app.BrowseButton = uibutton(app.Panel, 'push');
app.BrowseButton.ButtonPushedFcn = createCallbackFcn(app,
@BrowseButtonPushed, true);
app.BrowseButton.Position = [501 26 80 30];
app.BrowseButton.Text = 'Browse';
% Create EqualizerPanel
app.EqualizerPanel = uipanel(app.UIFigure);
app.EqualizerPanel.Title = 'Equalizer';
app.EqualizerPanel.Position = [31 309 643 320];
% Create HzSlider
app.HzSlider = uislider(app.EqualizerPanel);
app.HzSlider.Limits = [-15 15];
app.HzSlider.Orientation = 'vertical';
app.HzSlider.Position = [26 109 3 173];
% Create HzSlider_2
app.HzSlider_2 = uislider(app.EqualizerPanel);
app.HzSlider_2.Limits = [-15 15];
app.HzSlider_2.Orientation = 'vertical';
app.HzSlider_2.Position = [86 109 3 173];
% Create HzSlider_3
app.HzSlider_3 = uislider(app.EqualizerPanel);
app.HzSlider_3.Limits = [-15 15];
app.HzSlider_3.Orientation = 'vertical';
app.HzSlider_3.Position = [156 109 3 173];
% Create HzSlider_4
app.HzSlider_4 = uislider(app.EqualizerPanel);
app.HzSlider_4.Limits = [-15 15];
app.HzSlider_4.Orientation = 'vertical';
app.HzSlider_4.Position = [226 109 3 173];
% Create HzSlider_5
app.HzSlider_5 = uislider(app.EqualizerPanel);
app.HzSlider_5.Limits = [-15 15];
app.HzSlider_5.Orientation = 'vertical';
app.HzSlider_5.Position = [286 109 3 173];
% Create HzSlider_6
app.HzSlider_6 = uislider(app.EqualizerPanel);
app.HzSlider_6.Limits = [-15 15];
app.HzSlider_6.Orientation = 'vertical';
app.HzSlider_6.Position = [346 109 3 173];
% Create HzSlider_7
app.HzSlider_7 = uislider(app.EqualizerPanel);
app.HzSlider_7.Limits = [-15 15];
app.HzSlider_7.Orientation = 'vertical';
app.HzSlider_7.Position = [406 109 3 173];
% Create HzSlider_8
app.HzSlider_8 = uislider(app.EqualizerPanel);
app.HzSlider_8.Limits = [-15 15];
app.HzSlider_8.Orientation = 'vertical';
app.HzSlider_8.Position = [466 109 3 173];
% Create HzSlider_9
app.HzSlider_9 = uislider(app.EqualizerPanel);
app.HzSlider_9.Limits = [-15 15];
app.HzSlider_9.Orientation = 'vertical';
app.HzSlider_9.Position = [526 109 3 173];
% Create HzSlider_10
app.HzSlider_10 = uislider(app.EqualizerPanel);
app.HzSlider_10.Limits = [-15 15];
app.HzSlider_10.Orientation = 'vertical';
app.HzSlider_10.Position = [586 109 3 173];
% Create HzLabel_2
app.HzLabel_2 = uilabel(app.EqualizerPanel);
app.HzLabel_2.Position = [81 74 64 25];
app.HzLabel_2.Text = '201-400Hz';
% Create HzLabel
app.HzLabel = uilabel(app.EqualizerPanel);
app.HzLabel.Position = [21 52 57 27];
app.HzLabel.Text = '0-200Hz';
% Create HzLabel_3
app.HzLabel_3 = uilabel(app.EqualizerPanel);
app.HzLabel_3.Position = [151 50 89 29];
app.HzLabel_3.Text = '401-800Hz';
% Create HzLabel_4
app.HzLabel_4 = uilabel(app.EqualizerPanel);
app.HzLabel_4.Position = [221 75 70 24];
app.HzLabel_4.Text = '801-1500Hz';
% Create kHzLabel
app.kHzLabel = uilabel(app.EqualizerPanel);
app.kHzLabel.Position = [281 55 70 24];
app.kHzLabel.Text = '1.5-3kHz';
% Create kHzLabel_2
app.kHzLabel_2 = uilabel(app.EqualizerPanel);
app.kHzLabel_2.Position = [351 75 64 24];
app.kHzLabel_2.Text = '3-5kHz';
% Create kHzLabel_3
app.kHzLabel_3 = uilabel(app.EqualizerPanel);
app.kHzLabel_3.Position = [401 55 64 24];
app.kHzLabel_3.Text = '5-7kHz';
% Create kHzLabel_4
app.kHzLabel_4 = uilabel(app.EqualizerPanel);
app.kHzLabel_4.Position = [461 75 64 24];
app.kHzLabel_4.Text = '7-10kHz';
% Create kHzLabel_5
app.kHzLabel_5 = uilabel(app.EqualizerPanel);
app.kHzLabel_5.Position = [521 55 64 24];
app.kHzLabel_5.Text = '10-15kHz';
% Create kHzLabel_6
app.kHzLabel_6 = uilabel(app.EqualizerPanel);
app.kHzLabel_6.Position = [581 75 64 24];
app.kHzLabel_6.Text = '>15kHz';
% Create PresetsPanel
app.PresetsPanel = uipanel(app.UIFigure);
app.PresetsPanel.Title = 'Presets';
app.PresetsPanel.Position = [21 169 670 130];
% Create POPButton
app.POPButton = uibutton(app.PresetsPanel, 'push');
app.POPButton.ButtonPushedFcn = createCallbackFcn(app,
@POPButtonPushed, true);
app.POPButton.Position = [11 36 93 53];
app.POPButton.Text = 'POP';
% Create REGGAEButton
app.REGGAEButton = uibutton(app.PresetsPanel, 'push');
app.REGGAEButton.ButtonPushedFcn = createCallbackFcn(app,
@REGGAEButtonPushed, true);
app.REGGAEButton.Position = [111 36 103 53];
app.REGGAEButton.Text = 'REGGAE';
% Create ROCKButton
app.ROCKButton = uibutton(app.PresetsPanel, 'push');
app.ROCKButton.ButtonPushedFcn = createCallbackFcn(app,
@ROCKButtonPushed, true);
app.ROCKButton.Position = [221 37 100 52];
app.ROCKButton.Text = 'ROCK';
% Create TECHNOButton
app.TECHNOButton = uibutton(app.PresetsPanel, 'push');
app.TECHNOButton.ButtonPushedFcn = createCallbackFcn(app,
@TECHNOButtonPushed, true);
app.TECHNOButton.Position = [331 37 100 52];
app.TECHNOButton.Text = 'TECHNO';
% Create PARTYButton
app.PARTYButton = uibutton(app.PresetsPanel, 'push');
app.PARTYButton.ButtonPushedFcn = createCallbackFcn(app,
@PARTYButtonPushed, true);
app.PARTYButton.Position = [441 37 100 52];
app.PARTYButton.Text = 'PARTY';
% Create CLASSICALButton
app.CLASSICALButton = uibutton(app.PresetsPanel, 'push');
app.CLASSICALButton.ButtonPushedFcn = createCallbackFcn(app,
@CLASSICALButtonPushed, true);
app.CLASSICALButton.Position = [551 37 100 52];
app.CLASSICALButton.Text = 'CLASSICAL';
% Create SettingsPanel
app.SettingsPanel = uipanel(app.UIFigure);
app.SettingsPanel.Title = 'Settings';
app.SettingsPanel.Position = [20 21 671 137];
% Create PlayButton
app.PlayButton = uibutton(app.SettingsPanel, 'push');
app.PlayButton.ButtonPushedFcn = createCallbackFcn(app,
@PlayButtonPushed, true);
app.PlayButton.Position = [22 38 115 58];
app.PlayButton.Text = 'Play';
% Create ResumeButton
app.ResumeButton = uibutton(app.SettingsPanel, 'push');
app.ResumeButton.ButtonPushedFcn = createCallbackFcn(app,
@ResumeButtonPushed, true);
app.ResumeButton.Position = [374 38 115 58];
app.ResumeButton.Text = 'Resume';
% Create StopButton
app.StopButton = uibutton(app.SettingsPanel, 'push');
app.StopButton.ButtonPushedFcn = createCallbackFcn(app,
@StopButtonPushed, true);
app.StopButton.Position = [532 38 115 58];
app.StopButton.Text = 'Stop';
% Create PauseButton
app.PauseButton = uibutton(app.SettingsPanel, 'push');
app.PauseButton.ButtonPushedFcn = createCallbackFcn(app,
@PauseButtonPushed, true);
app.PauseButton.Position = [209 38 115 58];
app.PauseButton.Text = 'Pause';
% Create AxesPanel
app.AxesPanel = uipanel(app.UIFigure);
app.AxesPanel.Title = 'Axes';
app.AxesPanel.Position = [721 133 720 556];
% Create UIAxes
app.UIAxes = uiaxes(app.AxesPanel);
title(app.UIAxes, 'Title')
xlabel(app.UIAxes, 'X')
ylabel(app.UIAxes, 'Y')
zlabel(app.UIAxes, 'Z')
app.UIAxes.Position = [91 275 547 200];
% Create UIAxes_2
app.UIAxes_2 = uiaxes(app.AxesPanel);
title(app.UIAxes_2, 'Title')
xlabel(app.UIAxes_2, 'X')
ylabel(app.UIAxes_2, 'Y')
zlabel(app.UIAxes_2, 'Z')
app.UIAxes_2.Position = [91 15 547 200];
% Create OriginalLabel
app.OriginalLabel = uilabel(app.AxesPanel);
app.OriginalLabel.Position = [301 485 136 40];
app.OriginalLabel.Text = 'Original';
% Create AppliedFilterWaveformLabel
app.AppliedFilterWaveformLabel = uilabel(app.AxesPanel);
app.AppliedFilterWaveformLabel.Position = [321 215 136 40];
app.AppliedFilterWaveformLabel.Text = 'Applied Filter Waveform';
% Construct app
function app = tes
if nargout == 0
clear app
end
end
Output Waveform:
Observation-
1. User Interface (UI): The UI consists of several panels, buttons, sliders,
labels, and axes for visualization. There are panels for Equalizer settings,
Presets selection, Settings like play, pause, stop, and axes for displaying
original and modified audio waveforms.
2. Equalizers Sliders: Sliders are provided for adjusting frequency bands
ranging from 0-200Hz up to >15kHz. Each slider corresponds to a
specific frequency range, and its value determines the amount of
equalization applied to that range.
3. Presets: There are preset buttons for different music genres like POP,
REGGAE, ROCK, TECHNO, PARTY, and CLASSICAL. When a preset
button is clicked, the sliders adjust to predefined values suitable for that
genre.
4. Audio Processing: Each preset button has a corresponding function that
applies a specific effect to the audio. Effects include modifying frequency
bands, adding reverb, applying filters, etc. After applying the effect, the
modified audio waveform is plotted in one of the UI axes.
5. Playback Controls: Play, pause, stop, and resume buttons control the
playback of the audio. These buttons interact with an ‘audioplayer’ object
to manage audio playback.
6. File Selection: Users can select an audio file by browsing and selecting
the file address using the browse button.
7. Audio Visualization: Both the original and modified audio waveforms are
displayed in separate UIs axes for comparison.