glenjoy
Banned
- Joined
- Jan 1, 2004
- Messages
- 962
- Helped
- 72
- Reputation
- 146
- Reaction score
- 20
- Trophy points
- 1,298
- Location
- Philippines
- Activity points
- 0
glenjoy said:I think it is the voice band, 0 to 4khz.
Yes it will need a bunch of filters. There are 12 tones, so it requires 12 filters also.
%sampling frequency 8Khz
%i am not including any resolution factor here.. only math operations are
%performed.
%ex: x = sin(...) + sin(..) incase u need 8 bit resolution just modify this
%formula to x = 128 + 63*sin(...) + 63*sin(...)
% frequencies are 697,770,852,941,1209,1336,1477,1633 created using FIR
% Kaiser window at sampling rate of 8khz only. use FDA tool if necessity to
% modify
%misc parameters
f=[697,770,852,941,1209,1336,1477];
t = 1:320;
samp = 8000;
%sine wave and noise generation, gaussian for convenience
for i = 1:length(f),
sinw(i,:) = sin(2*pi*f(i)/samp * t);
sinn(i,:) = sinw(i,:) + randn(1,length(t));
end
%generate the summed waves that are possible. that is all the 12
%combinations
temp = 1;
for i = 1:4,
for j = 5:7,
sum_sin(temp,:) = sinn(i,:) + sinn(j,:);
temp = temp + 1;
end
end
f1 = f_697;
f2 = f_770;
f3 = f_852;
f4 = f_941;
f5 = f_1209;
f6 = f_1336;
f7 = f_1477;
out_1 = conv(sum_sin(1,:),f1) + conv(sum_sin(1,:),f5);
out_2 = conv(sum_sin(2,:),f1) + conv(sum_sin(2,:),f6);
out_3 = conv(sum_sin(3,:),f1) + conv(sum_sin(3,:),f7);
out_4 = conv(sum_sin(4,:),f2) + conv(sum_sin(4,:),f5);
out_5 = conv(sum_sin(5,:),f2) + conv(sum_sin(5,:),f6);
out_6 = conv(sum_sin(6,:),f2) + conv(sum_sin(6,:),f7);
out_7 = conv(sum_sin(7,:),f3) + conv(sum_sin(7,:),f5);
out_8 = conv(sum_sin(8,:),f3) + conv(sum_sin(8,:),f6);
out_9 = conv(sum_sin(9,:),f3) + conv(sum_sin(9,:),f7);
out_10 = conv(sum_sin(10,:),f4) + conv(sum_sin(10,:),f5);
out_11 = conv(sum_sin(11,:),f4) + conv(sum_sin(11,:),f6);
out_12 = conv(sum_sin(12,:),f4) + conv(sum_sin(12,:),f7);
plot(abs(fft(out_1)));
figure
plot(abs(fft(out_2)));
figure
plot(abs(fft(out_3)));
figure
plot(abs(fft(out_4)));
figure
plot(abs(fft(out_5)));
figure
plot(abs(fft(out_6)));
figure
plot(abs(fft(out_7)));
figure
plot(abs(fft(out_8)));
figure
plot(abs(fft(out_9)));
figure
plot(abs(fft(out_10)));
figure
plot(abs(fft(out_11)));
figure
plot(abs(fft(out_12)));
figure
glenjoy said:where to put wavread?
for i = 1:length(f),
sinw(i, : ) = sin(2*pi*f(i)/samp * t);
sinn(i, : ) = sinw(i, : ) + randn(1,length(t));
end
Mina Ayman said:I think that I can detect the number dialed without using a LPF.
Can I solve your problem without using a LPF or it's a must?
1209 Hz 1336 Hz 1477 Hz
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| | | |
| | ABC | DEF |
697 Hz | 1 | 2 | 3 |
|_ _ _ _ __ _ _ _ __ _ _ _ _ _|
| | | |
| GHI | JKL | MNO |
770 Hz | 4 | 5 | 6 |
|_ _ _ _ __ _ _ _ __ _ _ _ _ _|
| | | |
| PRS | TUV | WXY |
852 Hz | 7 | 8 | 9 |
|_ _ _ _ __ _ _ _ __ _ _ _ _ _|
| | | |
| | | |
941 Hz | * | 0 | # |
|_ _ _ _ __ _ _ _ __ _ _ _ _ _|
eYe said:Here is my solution.
You can use FFT for each wave and then find with frequency is the highest magnitude.
So, finally you may map it to which key was pressed.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?