1960 年左右,在郵遞區號出現之前,在購物中心出現之前,祖母與其他幾個人共用一條電話線。電話公司提供了每個顧客都有自己的鈴聲,請不要偷聽,這是不禮貌的。 這是北卡羅來納州首府,有 9 萬人。 幾年之內,她成為了派對線路上的最後一位,但電話公司被要求繼續向現有客戶提供派對線路費率。 幾年後,電話公司開始提供按鍵式撥號來取代圓形旋轉撥號盤(滴答-滴答-滴答-滴答-滴答......滴答-滴答-滴答......),但多年來爸爸一直保留著旋轉電話,這樣他就不必為更快的撥號支付 3 美元的附加費。 含有大量零的號碼撥打起來特別慢。 按鍵音速度很快。
按鍵音有雙音多頻(雙音多頻)訊號由人類語音範圍內的兩個同時正弦波產生,因此電話系統可以輕鬆傳輸它們。 有八種可用的音調,排列在 4 x 4 網格中。 您可能從未見過第四列。
| |
1209赫茲 |
1336赫茲 |
1477赫茲 |
1633赫茲 |
| 697赫茲 |
1 |
2 |
3 |
A |
| 770赫茲 |
4 |
5 |
6 |
乙 |
| 852赫茲 |
7 |
8 |
9 |
C |
| 941赫茲 |
* |
0 |
# |
D |
(Hz 是替換的單位消費者保護計劃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" )
);
20 世紀 80 年代初,The Phone Company 分拆為一家一群小公司擁有自己的電話變得合法。
請注意,祖母的聚會線路獨特鈴聲(可以告訴誰正在呼叫誰)與今天的鈴聲(可以告訴誰正在呼叫)之間的奇怪關係。
我還有固定電話。