大约在 1960 年,在邮政编码出现之前,在购物中心出现之前,祖母与其他几个人共享一条电话线路。电话公司提供了一个每位顾客都有独特的铃声,请不要偷听,不礼貌。 这是在北卡罗来纳州的首府城市,有 90,000 人。 几年之内,她成为了派对线上的最后一个,但电话公司被要求继续向现有客户提供派对电话费率。 几年后,电话公司开始提供按键式拨号以取代圆形旋转拨号盘(滴答滴答......滴答滴答......),但多年来爸爸一直保留着旋转电话,这样他就不必为更快的拨号支付 3.00 美元的附加费。 有很多零的号码拨起来特别慢。 按键音很快。
按键音是双音多频(双音多频)信号由人类语音范围内的两个同步正弦波组成,因此电话系统可以轻松传输它们。 有八种音调可用,排列在 4 x 4 网格中。 您可能从未见过第四列。
| |
1209赫兹 |
1336赫兹 |
1477赫兹 |
1633赫兹 |
| 697赫兹 |
1个 |
2个 |
3个 |
A |
| 770赫兹 |
4个 |
5个 |
6个 |
乙 |
| 852赫兹 |
7 |
8个 |
9 |
C |
| 941赫兹 |
* |
0 |
# |
丁 |
(赫兹是取代的单位CPS 1960 年。)
在这篇文章的末尾附有一个 DTMF3.wav 文件;它是用一个电脑麦克风压在电话听筒上制作的,有点安静。 为后面的脚本下载它;把你的扬声器调大一点听听。
该脚本通过加载样本矩阵从 wav 文件中恢复按键时域从文件中,然后运行 JMP快速傅里叶变换作用于时域数据的短部分以将其转换为频域. 在此图中,每个垂直的点列表示在该时间段内哪些频率特别响亮。 左下角的多余点可能是由于轻敲听筒上的麦克风造成的;尖锐的咔嗒声有很多频率。

第一个数字有很多 1477 Hz 的能量和很多 852 Hz 的能量。 这是一个9。 如果您想检查您在其余数字上的工作,请将您的答案与 JMP US 进行比较技术支持号码.
2016 年 12 月 20 日更新:JSL 在无法从旧博客格式转换后恢复。 如果您在过去几个月中得到一张空表且没有图表,请再试一次。 此外,这不是读取 WAV 文件的好模型;中的例子使用 WAV 文件更快,更有可能做你将来需要做的事情。
x = Load Text File( "$DESKTOP/DTMF3.wav", blob ); // this file must be 22050 16 bit 1 channel
// because the following code makes zero effort to handle anything else
x = Hex( x ); // doubles the size of the data, but the hex characters are easy to parse
If( Pat Match( x, Hex( "RIFF" ) + Pat Arb() + Hex( "data" ), "" ), // found the data chunk
grab = 2048; // samples per timeslice
period = grab / 22050; // seconds
binwidth = 1 / period; // 1 cycle in the bin's width is the lowest frequency the bins resolve
timeslice = 0; // count through the time slices
dt = New Table("sound",New Column("time"),New Column("frequency"),New Column("amp"));
dt << begin data update; // load the table without updating each time
While( Length( x ) > (grab) * 2 * 2, // grab samples * 2 bytesPerSample * 2 hexCharsPerByte
samples = J( grab, 1, 0 ); // an array to hold the samples; will be sent to the fft below
nsamples = 0; // grab counter
timeslice++; // each time we grab samples is a new time slice
Pat Match( x, // scan the hex data for pairs of hex digits
Pat Repeat(
Pat Len( 2 ) >> left1 + Pat Len( 2 ) >> left2 + // two pairs
// the following Expr evaluates to PatFence(), eventually, so it can be
// concatenated onto the preceding match. But before it does that, it
// stores the preceding match into the samples[ ] matrix
Expr( nsamples++; // index into the sample array
q = Hex To Number( left2 || left1 ); // build the 16 bit integer
If( q > 32767, q = q - 65536 ); // make it signed, +/-32K
samples[ Nsamples ] = q; // keep it
Pat Fence(); ), // make matching faster by fencing off completed work
grab, grab // min,max number of repeats
), "" // replace everything matched for this grab with nothing
);
freq = FFT( {samples} ); // run the fft. freq is a list: { real, imag }
amplitude = Sqrt( freq[1] :*</img> freq[1] + freq[2] :*</img> freq[2] ); // just the amplitude
For( f = 1, f < grab / 2, f++, // write data table
// throw out small amplitude responses and out-of-interest frequencies
// a different file might need some tweaking of these values
If( amplitude[F] > 10000 & f > 50 & f < 150, // roughly 500 to 1500 Hz
dt << addrows( 1 );
dt:time = timeslice * period;
dt:frequency = (f - 1) * binwidth; // bin 1 is really frequency 0, DC
dt:amp = amplitude[F];
)
);
);
dt << end data update;
// the pretty picture
dt << Graph Builder( Size( 664, 470 ), Show Control Panel( 0 ),
Variables( X( :time ), Y( :frequency ) ), Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, "time", ScaleBox, {Min( 0.5 ), Max( 9 ), Inc( 1 ),
Minor Ticks( 1 ), Label Row Nesting( 1 )} ),
Dispatch( {}, "frequency", ScaleBox,
{Min( 250 ), Max( 1750 ), Inc( 2000 ), Minor Ticks( 0 ), Label Row Nesting( 1 ),
Add Ref Line( 697, "Solid", "Black", "697Hz", 1 ),
Add Ref Line( 770, "Solid", "Black", "770Hz", 1 ),
Add Ref Line( 852, "Solid", "Black", "852Hz", 1 ),
Add Ref Line( 941, "Solid", "Black", "941Hz", 1 ),
Add Ref Line( 1209, "Solid", "Black", "1209Hz", 1 ),
Add Ref Line( 1336, "Solid", "Black", "1336Hz", 1 ),
Add Ref Line( 1477, "Solid", "Black", "1477Hz", 1 ),
Add Ref Line( 1633, "Solid", "Black", "1633Hz", 1 )}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "DTMF Analyzer" )} )
)
);
, // else...
Print( "not a wav file" )
);
1980 年代初期,The Phone Company 拆分为一堆小公司拥有自己的电话变得合法。
请注意祖母的聚会台词独特的铃声和今天的铃声之间的奇怪关系,前者告诉谁被呼叫,后者告诉谁正在打电话。
我还有固定电话。