Ask MATLAB Expert

Objective -

The objective of this project is to investigate the use of various signal processing techniques in extracting Electric Network Frequency (ENF) information from audio signals as a means of media authentication.

The Assignment: What is to be done?

For this project you need to write a Matlab function and a Matlab script.

Matlab function enf.m

The Matlab function enf.m will extract the ENF signal from a sound ?le. The call to enf.m should be in the form:

[y1, y2] = enf(x, Fs, BlockSize, ZeroPad, Overlap, Window, Frequency);

Input Variables and Parameters:

x: Lx-sample long one-dimensional input sequence x[n] containing samples of the sound file to be analyzed. In particular, x is a real-valued column vector of dimension Lx x 1.

Fs: Sampling rate of the input sequence x.

BlockSize: Parameter that determines the length of each subblock extracted from the input sequence x. For example, if {x1[n]} is the first subblock extracted from x, then {x1[n]} = { x[1]; : : : ; x[BlockSize] } -note that index starts at 1 to conform with Mat-lab programming standards. BlockSize also determines the size of the FFT algorithms to be used to transform blocks of data from time-domain to frequency-domain.

ZeroPad: Amount of zero padding to be used for Fourier analysis. For ZeroPad = Nz each windowed data segment extracted from the input sequence will be appended with Nz zero-valued sampled before transforming into the frequency domain.

Overlap: Input parameter that specifies overlap between successive subblocks extracted from the input sequence x. Overlap is specified as fraction of BlockSize with 0 ≤ Overlap < 1 such that Overlap = 0 corresponds to no overlap and Overlap = 1 corresponds to full overlap conditions.

Window: Window function fw[n]g to be applied to each input block fxm[n]g before transformed to frequency domain by DFT. The data array fw[n]g is a column vector of dimension BlockSize x 1. For example, Window = hanning(BlockSize).

Frequency: The ENF value to be analyzed. For example if you want to analyze ENF at line frequency then Frequency = 60, or if you want to analyze the first harmonic of the line frequency then Frequency = 120.

Output Variables:

y1: M x 1 dimensional maximum energy array as described in Equation (2).

y2: M x 1 dimensional weighted energy array as described in Equation (4).

Number of blocksM and therefore lengths of the y1 and y2 output data arrays is a function of the length of the input x[n], and the BlockSize, ZeroPad and BlockSize parameters.

Matlab script ENFproject.m

The Matlab script ENFproject.m is to demonstrate how the enf.m function developed earlier is to be used to operate on the maximum energy and the weighted energy arrays extracted from the reference sound file and the test sound file using the normalized cross-correlation analysis given in Equation (5).

The ENFproject.m scripts should compare the maximum energy and the weighted energy arrays extracted from the reference sound file and the test sound file using with and without pre-processing the sound files.

Comparison of reference and test sound files without pre-processing

Use the parameters:

  • Fs = 44100;
  • BlockSize = Fs * 16;
  • ZeroPad = 0;
  • Overlap = 0:5;
  • Window = hanning( BlockSize, 'periodic' );
  • Frequency = 120;

with sound files:

  • Reference file: ground truth.wav;
  • Test file: recording.wav.

Alternatively, you can use ground truth 2.wav and recording 2.wav.

The Matlab script file should use the above listed parameters to extract the maximum energy and weighted energy arrays from the specified reference and test sound files using the Matlab function enf.m. Perform normalized cross-correlation analysis first on the maximum energy arrays extracted from the reference and the test sound files to determine (if possible) the time-delay between the reference and test signals. Repeat the same analysis using the weighted energy arrays to estimate the time-delay between the reference and test signals.

Comparison of reference and test sound files with pre-processing

In this scenario you should first pre-process signals by decimating the sound files by a factor of 100. To achieve this objective design an appropriate lowpass filter, filter the audio signal and then down-sample by 100 before processing it further as before. In particular, use the following analysis parameters on the decimated audio signals:

  • Fs = 441; % sampling frequency after decimation
  • BlockSize = Fs * 16;
  • ZeroPad = 2ˆ14 Fs * 16;
  • Overlap = 0:5;
  • Window = hanning(???,'periodic'); ... % calculate the new block size after zero padding
  • Frequency = 120;

Repeat the same analysis as in the case of "without pre-processing" using the maximum energy and the weighted energy arrays to estimate the time-delay between the reference and test signals.

Attachment:- Assignment Files.rar

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92545518

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As