+ All Categories
Home > Documents > Jukebox Report on matlab

Jukebox Report on matlab

Date post: 26-Oct-2014
Category:
Upload: abhineet-kumar
View: 64 times
Download: 0 times
Share this document with a friend
Popular Tags:
19

Click here to load reader

Transcript
Page 1: Jukebox Report on matlab

JUKEBOX Using

N-band equaliser

DEPARTMENT OF ELECTRONICS & COMMUNICATION

ENGINEERING

SUBMITTED BY:- SUBMITTED TO:-

HIMANSHU CHAUHAN Dr.VIKRAM KARWAL

(09102306)

ABHINEET KUMAR

(09102279)

Page 2: Jukebox Report on matlab

CERTIFICATE

This is to certify that the work titled “JUKEBOX using N-BAND EQUALISER” submitted

by “HIMANSHU CHAUHAN AND ABHINEET KUMAR” in minor project of degree of Bachelor

of Technology of Jaypee Institute of Information Technology, Noida has been carried out

under my supervision. This work has not been submitted partially or wholly to any other

University or Institute for the award of this or any other degree or diploma.

Signature of Supervisor……………………………………. \

Name of Supervisor: Dr. VIKARAM KARWAL

Designation: ASSOCIATE PROFFESSOR

Department of Electronics and Communications Engineering

Jaypee Institute of Information Technology, Noida

Page 3: Jukebox Report on matlab

ACKNOWLEDGEMENT

First and foremost, we would like to thank God for blessing us with the strength, intelligence, and

patience to complete this project. We would like to express my sincere thanks to Dr. Vikram

Karwal who have been helping us by giving their valuable suggestions and guiding us right way

throughout the project.

We am extremely thankful to the Dean, Prof. Krishna Gopal and the HOD of Electronics and

Communication Engineering Department, Prof. R. C. Jain for providing the infrastructural

facilities to work in, without which this work would have not been possible.

Name of Student:- Signatures of students:-

Himanshu Chauhan ……………………………. Abhineet Kumar ………………………………

Date: …………………..

Page 4: Jukebox Report on matlab

INTRODUCTION

JUKEBOX is a term typically used to describe computer software for playing back multimedia files. While many media players can play both audio and video, others focus only on one media type or the other. Such players are known as either audio players or video players and often have a user interface tailored for the specific media type.

Media players often display icons known from physical devices such as tape

recorders and CD players. Examples of these icons are (play), (pause), and (stop).

An electronic device made of filters and amplifiers, used to alterthe relative strengths

of different frequencies in an electronicsignal. Equalizers are used primarily in audio

equipment, allowing fine tuning of the signal to

compensate for distortions such asweak response or oversensitivity at various freque

ncies. Agraphic equalizer uses a set of controls that determine thelevel of boost or su

ppression of individual frequencies. Thecontrols are usually sliding faders, set up in a

row from lowestfrequency to highest frequency, so that the final settingsresemble a

graph of the frequency response of the equalizer.

A band equalizer is a tool which is designed to change the output of sound by making adjustments within various bands set by the operator of the equalizer. Equalizers are used during recording to get sound of a clear, crisp quality and they are also utilized during production to further clean up recordings and get the best possible sound. In live performance, a band equalizer can be part of the sound system which is used to control quality. With a band equalizer, the goal is not to make sweeping changes to all of the sound, but to make changes within specific bands on the audio spectrum with the use of a band pass filter. This allows people to filter out very specific types of sounds without involving the signal as a whole. For example, a sound engineer working on recording a performing orchestra could use a band equalizer to isolate the sounds of different instruments, filter out sounds like feedback, shuffling feet, and other unwanted noises, and return a clear audio signal.

Page 5: Jukebox Report on matlab

TOOL USED:- MATLAB R2008a MATLAB (matrix laboratory) is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, and Fortran.

Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional package, Simulink, adds graphical multi-domain simulation and Model-Based Design for dynamic and embedded systems.

In 2004, MATLAB had around one million users across industry and academia. MATLAB users come from various backgrounds of engineering, science, and economics. MATLAB is widely used in academic and research institutions as well as industrial enterprises.

Page 6: Jukebox Report on matlab

GUI IN MATLAB:-

A GUI (graphical user interface) allows users to perform tasks interactively through

controls such as buttons and sliders. Within MATLAB®, GUI tools enable you to

perform tasks such as creating and customizing plots (plottools), fitting curves and

surfaces (cftool), and analyzing and filtering signals (sptool). You can also create

custom GUIs for others to use – either by running them in MATLAB or as standalone

applications.

GUIDE (GUI development environment) provides tools for designing and

programming GUIs. Using the GUIDE Layout Editor, you can graphically design your

GUI. GUIDE then automatically generates the MATLAB code that defines all

component properties and establishes a framework for GUI callbacks (routines that

execute when a user interacts with a GUI component).

Page 7: Jukebox Report on matlab

FILTERS USED FOR IMPLEMENTING EQUALIZER:-

1.High shelving filter:- A high shelf filter will cut or boost signals of

frequencies ABOVE “fc”. Below the cutoff frequency, the input signal is unaffected. This operates opposite to a low shelf filter. Below is the response output of a high shelf filter used in cutting signals above “fc”

.

INPUT OUTPUT A common implementation of high shelf filter reduction is similar to a low pass filter such as noise filtering. Unlike a low pass filter which is designed only for “attenuation” or “cutting signals”. A high shelf filter can also be used to boost signals above the cut off frequency

EQUATIONS:-

• A = 10[(G /20)]1/2

• ωc = 2⋅π ⋅ f f • ωS = sin( ωc)

• ωC = cos (ωc)⋅ .α =ωS/(2.Q)

.β = A^1/2

/Q

Page 8: Jukebox Report on matlab

• b0 = A⋅{(A+1)+[(A−1)⋅ωC]+ (β ⋅ωS )} • b1 = −2⋅ A⋅{(A−1)+[(A+1)⋅ωC]} • b2 = A⋅{(A+1)+[(A−1)⋅ωC]− (β ⋅ωS )} • a0 ={(A+1)−[(A−1)⋅ωC]+ (β ⋅ωS )} • a1= 2⋅{(A−1)−[(A+1)⋅ωC]} • a2 ={(A+1)−[(A −1)⋅ωC]− (β ⋅ωS )}

2.LOW SHELVING FILTER:- A low shelf filter will cut or boost signals of

frequencies BELOW “fc” or cutoff frequency. Above fc, the frequency response will not be altered and will pass normally. Below is the screenshot of a low shelf filter used in cutting signals of frequencies below the cutoff “fc

Low shelf filter is commonly used during guitar EQ mixing and mixing vocals. The purpose is to cut the lower bass frequencies of each instruments so that it won’t conflict with the bass guitar and kick drum frequencies.

However, common misconception is using only the low shelf filter for cutting signals below the cut off frequency. This is not true in all cases. Sometimes, you will use a low shelf filter to boost the frequencies below the cutoff

INPUT OUTPUT

Page 9: Jukebox Report on matlab

• b0 = A⋅{(A+1)-[(A−1)⋅ωC]+ (β ⋅ωS )} • b1 = −2⋅ A⋅{(A−1)-[(A+1)⋅ωC]} • b2 = A⋅{(A+1)-[(A−1)⋅ωC]− (β ⋅ωS )} • a0 ={(A+1)+[(A−1)⋅ωC]+ (β ⋅ωS )} • a1= 2⋅{(A−1)+[(A+1)⋅ωC]} • a2 ={(A+1)+[(A −1)⋅ωC]− (β ⋅ωS )}

3.PEAK FILTERS:-In this filter the centre frequency is boosted only

resulting in the change of gain of that particular frequency.

• b0 =1+(α ⋅ A)

• b1 = −2⋅ωC

• b2 = 1−(α ⋅ A)

• a0= 1+(α A)

• a1 = −2⋅ωC

• a2 = 1−(α A)

Page 10: Jukebox Report on matlab

FUNCTIONS USED:- 1.Get:- get(h,'PropertyName') returns the value of the property 'PropertyName' of the graphics object identified by h. a = get(h,'DefaultObjectTypePropertyName')

2.Set:- set(H,'PropertyName',PropertyValue,...) sets the named

properties to the specified values on the object(s) identified by H. H can be a vector of handles, in which case set sets the properties' values for all the objects. a=set(H,'PropertyName',PropertyValue,...)

3.Uicontrol:- Uicontrol creates a uicontrol graphics objects (user

interface controls), which you use to implement graphical user interfaces. handle = uicontrol('PropertyName',PropertyValue,...) creates a uicontrol and assigns the specified properties and values to it. It assigns the default values to any properties you do not specify. The default uicontrol style is a pushbutton. The default parent is the current figure. See the Uicontrol Properties reference page for more information. handle = uicontrol(parent,'PropertyName',PropertyValue,...) creates a uicontrol in the object specified by the handle, parent. If you also specify a different value for the Parent property, the value of the Parent property takes precedence. parent can be the handle of a figure, uipanel, or uibuttongroup. handle = uicontrol('PropertyName',PropertyValue,...) uicontrol('Style', 'slider',...

'Min',g1,'Max',g2,'Value',0,...

'units',pu,....

Page 11: Jukebox Report on matlab

'Position', [x y 1.5*sz szy],...

'Callback', 'recalculate_filter;');

4.Uigetfile:- uigetfile displays a modal dialog box that lists files in the

current directory and enables the user to select or type the name of a file to be opened. If the filename is valid and if the file exists, uigetfile returns the filename when the user clicks Open. Otherwise uigetfile displays an appropriate error message from which control returns to the dialog box. The user can then enter another filename or click Cancel. If the user clicks Cancel or closes the dialog window, uigetfile returns 0. [FileName,PathName,FilterIndex] = uigetfile(FilterSpec) displays only those files with extensions that match FilterSpec. The uigetfile function appends 'All Files' to the list of file types.FilterSpec can be a string or a cell array of strings, and can include the * wildcard. [FileName,PathName,FilterIndex]=uigetfile({'*.mp3;

*.wav;*.wma;*.avi;*.mpg','mediafiles(*.mp3,*.wav,*

.wma,*.avi,*.mpg)';'*.*', 'All Files

(*.*)'},'File Selector') ;

5.mmfileinfo:- info = mmfileinfo(filename) returns a structure, info,

with fields containing information about the contents of the multimedia file identified by filename. The filename input is a string enclosed in single quotes.

ainfo=mmfileinfo(fln);

Page 12: Jukebox Report on matlab

6. wavread:- y = wavread(filename) loads a WAVE file specified by the

string filename, returning the sampled data in y. If filename does not include an extension, wavreadappends .wav. [y, Fs] = wavread(filename) returns the sample rate (Fs) in Hertz used to encode the data in the file.

[s Fs]=wavread(fln);

7. analogoutput:- AO = analogoutput('adaptor') creates the analog

output object AO for a sound card having an ID of 0 (adaptor must be winsound). This is the only case where ID is not required Arguments

'adaptor' The hardware driver adaptor name. The supported adaptors are advantech, mcc, nidaq, and winsound.

ID The hardware device identifier. ID is optional if the device object is associated with a sound card having an ID of 0.

AO The analog output object.

8.addchannel:- Add hardware channels to analog input or output

object chans = addchannel(obj,hwch) adds the hardware channels specified by hwch to the device object obj. The MATLAB indices associated with the added channels are assigned automatically. chans is a column vector of channels

ch = addchannel(ao,1:2);

9.filter:- y = filter(b,a,X) filters the data in vector X with the filter

described by numerator coefficient vector b and denominator coefficient vector a. If a(1) is not equal to 1, filter normalizes the filter coefficients by a(1). If a(1) equals 0, filter returns an error.

Page 13: Jukebox Report on matlab

filter(hd1,d1(:,1))

10.putdata:- Queue analog output data in engine for eventual output

putdata(obj,data) queues the data specified by data in the engine for eventual output to the analog output subsystem. data must consist of a column of data for each channel contained by obj. That is, data must be an m-by-n matrix, where m rows correspond to the number of samples and n columns correspond to the number of channels in obj . Data can consist of doubles or native data types but cannot contain NaNs. Data must contain a column of data for each channel contained in obj. If data contains any data points that are not within the UnitsRange of the channel it pertains to, the data points will be clipped to the bounds of the UnitsRange property. data can be a tscollection object or timeseries object. If data is a tscollection object, there must be one timeseries per channel in obj. If data is atimeseries object, there must be only one channel in obj. If the tscollection or timeseries object contains gaps, or is sampled at a different rate than theSampleRate of obj, the data will be resampled at the rate of obj using a zero order hold. Syntax

putdata(obj,data)

Arguments

obj An analog output object.

data The data to be queued in the engine.

putdata(ao,d1);

Page 14: Jukebox Report on matlab

11.dfilt.df1sos:- Discrete-time, second-order section, direct-form I

filter Hd = dfilt.df1sos(s) returns a discrete-time, second-order section, direct-form I filter, Hd, with coefficients given in the s matrix. The filter states for this object are stored in a filtstates object.

hd1=dfilt.df1sos(ss);

12. freqz:- Frequency response of filter.

freqz returns the frequency response based on the current filter coefficients. This section describes common freqz operation with adaptive filters, discrete-time filters, multirate filters, and filter System objects. [h,w] = freqz(hfilt) returns the frequency response h and the corresponding frequencies w at which the filter response of hfilt is computed. The frequency response is evaluated at 8192 points equally spaced around the upper half of the unit circle.

[h,w] = freqz(hd1);

13. stop:- Stop device object.

stop(obj) terminates the execution of the device object obj.

Syntax

stop(obj)

Arguments

Obj = A device object or an array of device objects.

Stop(ao)

Page 15: Jukebox Report on matlab

14. exist:- Check existence of variable, function, folder, or class

Syntax

exist name

Page 16: Jukebox Report on matlab

IMPLEMENTATION:- 1.Equaliser 2.audio read 3.open device

a) Add to buffer b) Display time script

4.recalculate filter i) High shelving filter ii) Low shelving filter iii) Peak shelving filter

Page 17: Jukebox Report on matlab

GUI beforehand:-

Page 18: Jukebox Report on matlab

GUI after code run:-

Page 19: Jukebox Report on matlab

BIBliography Web refrences:- www.google.com

www.wikipedia.com

www.youtube.com

www.nptl.com

http://www.audiorecording.me/what-is-a-low-shelf-and-high-shelf-filter-in-parametric-equalization.html

https://ccrma.stanford.edu/~jos/filters/Low_High_Shelving_Filters.html

http://www.ovnilab.com/articles/eqtypes.shtml


Recommended