Write a matlab function and a matlab script

Assignment Help MATLAB Programming
Reference no: EM131736832

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

Reference no: EM131736832

Questions Cloud

What brands and products do you feel successfully speak : HI5004 Marketing Management Assessment. What brands and products do you feel successfully speak to you and effectively target your age group
How proposed strategies align with the global considerations : Examination of how each of your proposed strategies align with the global social, ethical, and legal considerations that may affect your selected company.
How do global social values affect resource allocation : How do global social values affect resource allocation and the measurement process in a company's implementation of its strategic plan?
What was the bidding process that was used : What was the bidding process that was used? Be specific. In depth, explain the various elements of the bidding process that was used.
Write a matlab function and a matlab script : The objective of this project is to investigate the use of various signal processing techniques in extracting Electric Network Frequency
What kind of output control will best facilitate interaction : You have been asked by your company's CEO. What kind of output controls will best facilitate positive interactions both within the teams and among the teams?
How close was pacific lumber to a sustainable enterprise : Who are the material stakeholders of Pacific Lumber, and what is the primary concern for each? How close was Pacific Lumber to a sustainable enterprise?
What skills do people in the given field rely upon most : What skills do people in this field rely upon most? What additional credentials would enhance a person's credibility in this field.
What does the experiment tell you about yourself : What does this experiment tell you about yourself and others in terms of moral reasoning? What answers did you select and why did you select them?

Reviews

len1736832

11/24/2017 6:59:29 AM

Please check the assignment very carefully and let us know if you will be able to complete the assignment with good quality and within the deadline. Let us know if you have any confusion or unable to understand any part of the requirement so that it can be clarified with the student. You may be charged for a penalty in case of delayed or plagiarized solutions. Please DO NOT start working on the assignment before it is confirmed to you through email. Read all the instructions carefully before starting the work and follow them while solving the assignment. Note: If solutions are not posted as per given deadline, late submission penalty would be applied.

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd