フィルターのクリア

Need Help with Telephone Dialing Signal

4 ビュー (過去 30 日間)
Hannah Chamberlain
Hannah Chamberlain 2017 年 4 月 6 日
コメント済み: Star Strider 2017 年 4 月 7 日
So I'm suppose to take the file I have. Read it, play it and then plot the magnitude and Phase of the DFT signal versus the frequency in Hz. I think I got the first part right.
The problem I have is that I also need to include vertical dotted lines at each of the DTMF column and row frequencies. Then I need to decode the number dialed from the DFt. I did find this resource that seemed to help but I couldn't find the actual code. Any help would be greatly appreciated.
clear; clc;
[data,Fs] = audioread('tel.wav'); % Read the audio file and store the audio in data and sampling rate into fs
player = audioplayer(data,Fs);
play(player);
NFFT = length(data);
Y = fft(data,NFFT);
F = ((0:1/NFFT:1-1/NFFT)*Fs).';
magnitudeY = abs(Y); % Magnitude of the FFT
phaseY = unwrap(angle(Y)); % Phase of the FFT
tone= abs(data)';
figure
subplot(2,1,1)
plot(F,magnitudeY)
title('Magnitude')
line([1209 697], [0 500],'LineStyle',':'); % dotted line at DTMF?
subplot(2,1,2)
plot(F,phaseY)
title('Phase')
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 4 月 6 日
https://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22dtmf%22

サインインしてコメントする。

回答 (2 件)

Hannah Chamberlain
Hannah Chamberlain 2017 年 4 月 6 日
I tried searching and couldn't figure it out. I'm sorry. I'm so lost.

Star Strider
Star Strider 2017 年 4 月 6 日
  2 件のコメント
Hannah Chamberlain
Hannah Chamberlain 2017 年 4 月 7 日
How would I load my sound file into it? I have it as a .wav file. How would I change the type? Would the code I haven't work?
Star Strider
Star Strider 2017 年 4 月 7 日
Use the audioread function. It will give you the signal (in my code, ‘x’) and the sampling frequency (in my code ‘fs’). See the documentation on audioread for details on how to use it.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by