# Homework Help: Help with matlab

1. Oct 31, 2014

### noname1

• OP warned about not using homework template
i am trying to figure out digits in a dtmf signal using matlab with the fft command however i not sure how to figure out what digit is being pressed.

I am doing this

stem(abs(signal)) and get a plot with several digits pressed but not sure how to figure out which are pressed, any help would be appreciated

2. Oct 31, 2014

### Staff: Mentor

DTMF stands for dual tone multifrequency. Each key on the keypad causes two frequencies to be generated. With your stem plot, you should be getting two vertical bars for each DTMF tone.

For example, the frequencies for the '1' key are 697Hz and 1209Hz. See the table in the Keypad section here - http://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling.

3. Oct 31, 2014

### noname1

thank you for your reply, i understand how dmtf works however the results i am getting are not making sense to me, for example i am getting this, not sure how to view the higher and lower frequencies

#### Attached Files:

• ###### example.jpg
File size:
21 KB
Views:
173
4. Oct 31, 2014

### Staff: Mentor

The difficulty is in working with several keys at the same time. Is there any way to look at the plot of one key at a time? Also, what's causing the spikes at around 6500 Hz and 7000 Hz? Those are DTMF signals.

5. Oct 31, 2014

### noname1

not sure how to process that in matlab, i know how many samples and spacing per key how can i process just certain samples with fft?

i tried fft(singal,[],dim); where dimension is a vector [start:end] however i get an error

"Dimension argument must be a positive integer scalar within indexing range."

regarding the 6k and 7k spikes, not sure what they are because there is nothing in that range

thank you for your time in trying to explain it to me

6. Oct 31, 2014

### Staff: Mentor

7. Oct 31, 2014

### noname1

i looked at that however i really dont understand how to do it by sections, in dimensions i tried using a vector with start:end but it always gives me the error above, could you explain how it works?

8. Nov 1, 2014

### Staff: Mentor

That dim argument needs to be a scalar value, not a vector. Your signal argument is a vector, right? You can call the fft function like this:
Code (Text):
Result = fft(signal, N)
Here N is the number of elements in the signal vector. The documentation isn't as clear as it could be, and I don't have matlab to test things, but N might need to be a power of 2, like in the example on this doc page -- http://www.mathworks.com/help/matlab/ref/fft.html.