大約在 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 拆分為一堆小公司擁有自己的電話變得合法。
請注意祖母的聚會台詞獨特的鈴聲和今天的鈴聲之間的奇怪關係,前者告訴誰被呼叫,後者告訴誰正在打電話。
我還有固定電話。