Professional Documents
Culture Documents
24743 Users
• Applicat
ions
• News
Your Electronics Open
Source • Datash
eet
• SEAR
CH
About
Download
Contact
Team
○ Stories
Hardware
Login / Register
Linux
Microcontrollers
News
Programming
Technology
Widget
• dtmf
• matlab
3digg
Sampling and Generation
In mathematics a signal is a real function of a real variable f(t). In electronics it represents the evolution of a v
Simplified diagram to generate an arbitrary signal v(t) from a digital format v(i) is the following:
First of all, the information is available in digital format, inside a file in the vector numbers format (samples).
to a digital-to-analog converter that produces a voltage signal to output to the external world, after an appropr
states that the sampling frequency fs must satisfy the following relation:
fs ≥ 2B, where B is the absolute band of the output signal. Details on the sampling theorem can be found in li
Even if the DAC can assure high sampling frequency, the absolute band of the signal that has to be generated
stage of the audio card. Because it's designed for sound applications, it's equipped with an amplifier with a 20
It must be also taken into account that the output signal will be distorted in amplitude and phase, more around
the generation of signals having with bandwidth lower than about 10KHz.
Matlab supplies different internal functions to generate a waveform. Most of these require a preliminary state
sample frequency of fs[Hz] it's possible to produce a time vector by writing: t=linspace(0, end, end*fs . This
zero to end second, divided in end*fs points.
t=linspace(0, 2, 2*10000)
y=sin(2*pi*20*t)
plot(t, y)
The following source allows to generate with Matlab a 12 seconds dtmf.wav file that reproduces, at interval o
tones of the buttons:
0-1-2-3-4-5-6-7-8-9-*-#
%------------------------------
%-- EXAMPLE OF DTMF GENERATION
%------------------------------
y0 = sin(2*pi*fc3*t) + sin(2*pi*fr2*t); % 0
y1 = sin(2*pi*fc1*t) + sin(2*pi*fr1*t); % 1
y2 = sin(2*pi*fc1*t) + sin(2*pi*fr2*t); % 2
y3 = sin(2*pi*fc1*t) + sin(2*pi*fr3*t); % 3
y4 = sin(2*pi*fc2*t) + sin(2*pi*fr1*t); % 4
y5 = sin(2*pi*fc2*t) + sin(2*pi*fr2*t); % 5
y6 = sin(2*pi*fc2*t) + sin(2*pi*fr3*t); % 6
y7 = sin(2*pi*fc3*t) + sin(2*pi*fr1*t); % 7
y8 = sin(2*pi*fc3*t) + sin(2*pi*fr2*t); % 8
y9 = sin(2*pi*fc3*t) + sin(2*pi*fr3*t); % 9
y_start = sin(2*pi*fc3*t) + sin(2*pi*fr1*t); % *
y_canc = sin(2*pi*fc3*t) + sin(2*pi*fr3*t); % #
y=zeros(1,length(t));
k=0;
s=length(y)-1;
s=s+1;
for i=1:s
if k < s/12
y(i)=y0(i);
elseif k >= s/12 && k <((2*s)/12)
y(i)=y1(i);
elseif k >= ((2*s)/12) && k <((3*s)/12)
y(i)=y2(i);
elseif k >= ((3*s)/12) && k <((4*s)/12)
y(i)=y3(i);
elseif k >= ((4*s)/12) && k <((5*s)/12)
y(i)=y4(i);
elseif k >= ((5*s)/12) && k <((6*s)/12)
y(i)=y5(i);
elseif k >= ((6*s)/12) && k <((7*s)/12)
y(i)=y6(i);
plot(t,y*0.4); wavwrite(y*0.4,fs,'dtmf.wav');
• eostech's blog
• 2140 reads
Taxonomy Who's new Folksonomy Tag Cloud
Category Tags • Argupsr
8bit 16 bit adc ADI AMD amplifier arduino ARMa
ANALOG or
APPLICATI • 97Zimra charger Bluetooth Capacitor cmos ColdFire Designd
ON-NOTE • evapterh d linux embedded os embedded system Ethernet Fairch
DATABOO eam
K • Ronesoal LED LED Driver Lin
to i2c Intel interface iphone lcd
DATASHEE lumma
T Technology linux maxim mcu memsMicroch
DIY • Infulsean
Electronics aere amp open sourcePCB pic pic32 power
Parts • irriltFliet
EMBEDDE te supply processorprogramming pwm Resistor rf rto
D • JerTraur deo wireless Zetex zigbee
FIRMWARE ecync
HACK • hazra.4u
HARDWAR
• tacyDeer
E
cedar
HOMEMAD
E • weceone
HowTo rZerge
LINUX Who's
MICROCON
TROLLERS
online
NEWS There are
PCB currently 0
PROGRAM users and 3
MING guests online.
PROJECTS
REFERENC
E DESIGN
ROBOTICS
STANDAR
DS
TECHNOLO
GY
TOOLS
TUTORIAL
S
VINTAGE
Trademarks