MATLAB: output the frequency components of a DTMF signal

In summary, the person is asking for help with creating a function to output the low and high frequency components of a DTMF signal. They say that they don't even know where to start, and that they need help understanding what the table is supposed to mean.
  • #1
makovx
23
0

Homework Statement



I badly needed an urgent help in Matlab.

I have to create a Matlab function (M-File) that will output the low (flow) and high (fhigh) frequency components of a DTMF signal given the numeric symbol (x) (* and # not included).

I don't even know where to start since this is not discussed. A table is given such that

_______1209 Hz __1336 Hz___1477 Hz
697 Hz____1________2_________3
770 Hz____4________5_________6
852 Hz____7________8_________9
941 Hz____*________0 _________#


Homework Equations



Each pair of tones contains one frequency of the low group (697 Hz, 770 Hz, 852 Hz, 941 Hz) and one frequency of the high group (1209 Hz, 1336 Hz, 1477Hz) and represents a unique symbol. What should I do first?

here's the format..

function [flow fhigh]=mydtmf(x)



The Attempt at a Solution



the output must produce something like this...

[flow fhigh]=mydtmf(1)
flow =
697
fhigh =
1209

>> [flow fhigh]=mydtmf(2)
flow =
697

fhigh =
1336



all help would be deeply appreciated.
 
Physics news on Phys.org
  • #2
DTMF = dual-tone multifrequence. These are the tones produced by the keys on a telephone keypad.

Given a digit 0, 1, 2, ... , 9, your routine should set flow and fhigh. Probably the simplest but least elegant way to do this is to use brute force with lots of if ... elseif statements.
 
  • #3
i tried doing the if...for... else..elseif statements but I still can't do it right.
I mean for me to write a function, I have to write something like this

function [flow fhigh]= mydtmf (x)

wherein x is the number 0 to 9.

but it says that variable x is not initialized. what does it mean?
how to initialize the variable x?
 
  • #4
It means that the parameter x in your function doesn't have a value yet. Before you call your function you have to give x a value, most likely by input from the keyboard. It's sort of like me asking you to tell me the square root of a number without first telling you the number.
 
  • #5
function [flow fhigh]= mydtmf(x)
x = input('number from 0-9: ')
if x>=0 & x<=9
[flow fhigh]= mydtmf(x)

for x==1,
disp('flow = 697 Hz')
disp('fhigh = 1209 Hz')
end

for x==2,

disp('flow = 697 Hz')
disp('fhigh = 1336 Hz')
end

for x==3,

disp('flow = 697 Hz')
disp('fhigh =1477 Hz')
end

for x==4,

disp('flow = 770 Hz')
disp('fhigh = 1209 Hz')
end

for x==5,

disp('flow = 770 Hz')
disp('fhigh = 1336 Hz')
end

for x==6,

disp('flow = 770 Hz')
disp('fhigh = 1477 Hz')
end

for x==7,

disp('flow = 852 Hz')
disp('fhigh = 1209 Hz')
end

for x==8,

disp('flow = 852 Hz')
disp('fhigh = 1336 Hz')
end

for x==9,

disp('flow = 852 Hz')
disp('fhigh = 1477 Hz')
end

for x==0,

disp('flow = 941 Hz')
disp('fhigh = 1336 Hz')
end
end

this is my syntax. but when i tried to rum it, here's what I've got...

?? Error: File: D:\matlab7\mydtmf.m Line: 6 Column: 10
Missing variable or function.

Line:6 Column 10 is the part of

for x==1
 
  • #6
You are (incorrectly) attempting to use for loops when you don't want any loops at all. What you want instead are are series of if ... elseif statements. If you don't have any documentation, here is a link to some that might be helpful -- http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/getstart.pdf. Chapter 4 has information about control logic (including if statements and for loops) and how to write functions.
 

FAQ: MATLAB: output the frequency components of a DTMF signal

What is a DTMF signal?

A DTMF (Dual-Tone Multi-Frequency) signal is a type of audio signal that is used in telecommunication systems to represent digits, symbols, or commands. It is generated by pressing buttons on a telephone keypad or other similar devices.

Why is it important to output the frequency components of a DTMF signal?

Outputting the frequency components of a DTMF signal allows us to analyze and understand the signal better. It can help us identify the specific tones and frequencies that make up the signal, and can also be used for signal processing and decoding purposes.

How can I output the frequency components of a DTMF signal in MATLAB?

In MATLAB, you can use the fft function to compute the frequency components of a DTMF signal. First, you will need to import the signal into MATLAB and then use the fft function to convert the signal from the time domain to the frequency domain.

What does the output of the frequency components of a DTMF signal represent?

The output of the frequency components of a DTMF signal represents the different tones and frequencies that make up the signal. Each button on a telephone keypad is associated with a specific combination of two frequencies, and the output will show these frequencies as peaks in the frequency spectrum.

Can I use the frequency components of a DTMF signal for decoding purposes?

Yes, the frequency components of a DTMF signal can be used for decoding purposes. By comparing the frequency components of a received DTMF signal to a known set of frequencies, we can determine which buttons were pressed and decode the signal accordingly.

Back
Top