Purchase Solution

Matlab Program Example Problem

Not what you're looking for?

Ask Custom Question

Problem Statement:

1) Prompt a user to enter a .wav filename where the DTMF tones are stored. Load the recorded tones. Use the .wav file provided called project5.wav. (NOTE: this file is on my computer and is not presented.), but the file contains simulated tones for the numbers 24680 which where generated using a previous program which is not important.
2) Plot the signal representing the tones versus time.
3) Use the command ginput to determine the number of tones and set break points to separate the individual tones.
4) Use Matlab's fft function to calculate the magnitude spectrum for each digit.
5) Plot the signals for each digit and their magnitude spectrum. Arrange the graphs so that each page (figure window) contains six graphs labeled. A signal and its magnitude must be displayed next to each other(1st pane has a signal and 2nd pane has its spectrum)

THE code I have that may help:

clear,clc,close all;
filename=input('Enter wavfilname, project5.wav','S');
%>>project5.wav
(y,fs)=wavread(filename)
fs=4000; %sampling freq
dt=1/fs; %time step
fo=1000; % signal frequency
T=1/fo;
t=[0:dt:200*T-dt]
x=sin2*pi*10*t
plot(t,x)
(x,y)=ginput(6) % 6 means 6 mouse clicks only to work on plot
%then on command window see x= a number
a number, etc.
y= a number
a number etc.
% only want x axis, so ignore y axis and to do so...
index1=round(1)/dt
f=g(1:index1);
f1=t(1:index)
plot(t,f)

OK, other code have to use the fft function to find the amplitude spectrum of a sinusoid. Here it is:
clear, clc, close all;
fs=4000;
dt=1/fs;
fo=1000;
T=1/fo;
t=[0:dt:200*T-dt];
x=sin(2*pi*fo*t);
N=length(x);
XF=fft(x)/N;
XFM=abs(fftshift(XF));
freq=[-N/2:N/2-1]*fs/N;
plot(freq,XFM)
figure
stem(freq,XFM) % to get rid of extra little side spectrum's due to the way Matlab uses math to calculate a spectrum...

Purchase this Solution

Solution Summary

This solution provides assistance with the Matlab program problem.

Solution Preview

Please see the attachment for solution.

Also attached is the wav file of the number 12345 that is used in ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Javscript Basics

Quiz on basics of javascript programming language.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.