Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me in Matlab and Wav File ** Will donate 100 points **

Status
Not open for further replies.

glenjoy

Banned
Joined
Jan 1, 2004
Messages
962
Helped
72
Reputation
146
Reaction score
20
Trophy points
1,298
Location
Philippines
Activity points
0
matlab wav

Can someone help me in designing a low pass filter in Matlab, the input file is a DTMF wav file, only given is sampling rate of 8kHz and, 40ms duration.

Thanks.
 

matlab .wav

Hi,

Which is the bandwidth of the filter (passband and stopband)?

Regards,

--rs
 

sine wave tone matlab

I think it is the voice band, 0 to 4khz.
 

    V

    Points: 2
    Helpful Answer Positive Rating
dtmf tones matlab

glenjoy said:
I think it is the voice band, 0 to 4khz.

sampling rate 8khz ok! but what is that 40 ms duration?

one more doubt i have.. u say sampling rate is 8khz, it is the sapling rate of the wave file. then, for it to be effectively reconstructed, the largest frequency must be < Fs/2 = 4khz. then u are applying a lpf from 0 to 4khz? then wouldnt it appear as an all pass filter? pls explain me incase i am wrong.. am very much confused!

/cedance
 

    glenjoy

    Points: 2
    Helpful Answer Positive Rating
wav matlab

hi,

i am sorry, i couldnt get your question yet! :( it appears too vague to me, i would like to help u in this regard, thou. if you could provide the information a little clearer.

/cedance
 

    glenjoy

    Points: 2
    Helpful Answer Positive Rating
dtmf tones in matlab

Okay here is the problem, the input is a sound (DTMF) with noise in it, the noise must be filtered so that the the equation what number is the DTMF tone.

Sampling Frequency is 8khz. So it needs a low pass filter or a bandpass filter. As long as noise will be filtered out and all DTMF tones can pass through.
 

matlab generate wave file

Yes it will need a bunch of filters. There are 12 tones, so it requires 12 filters also.
 

change the bit resolution of audio matlab

Yes it will need a bunch of filters. There are 12 tones, so it requires 12 filters also.

I would say 7. 3 x 4 =12. It's an array.
 

matlab wav filtering

well, i have settled to finish it.. dont know if i proceeded right! (not for 100 points :))

the main file i am pasting here.. and teh complete one i am attaching. the last set of lines.. was lazy to put a loop.. so cut and paste! :D


Code:
%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


/cedance
 

    glenjoy

    Points: 2
    Helpful Answer Positive Rating
find duration of wav file in matlab

where to put wavread?
 

to generate a 4 khz tone matlab

glenjoy said:
where to put wavread?

here is the sinewave of independent frequencies generatioon loop.

Code:
for i = 1:length(f),
sinw(i, : ) = sin(2*pi*f(i)/samp * t);
sinn(i, : ) = sinw(i, : ) + randn(1,length(t));
end

just change this with wave read. and in teh end, again use wavwrite. :) see the filter coefficients i have attached also.

/cedance
 

    glenjoy

    Points: 2
    Helpful Answer Positive Rating
wav matlab

How to change with wavread?

Added after 5 hours 7 minutes:

The wavfile given are tones from different number in
DTMF. A number is composed 1024 samples. The sampling
frequency is 8000 Hz. Your task is to identify the
number
 

wav filter matlab

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?
 

matlab wav filter

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?

Low pass filter is not a must, the wav file is mixed with noise but maybe you have other technique to remove the noise.
 

matlab.wav

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.
 

filter a sound file bandwidth matlab

Have you tried searching MathWorks for "DTMF"? This is the first hit:
**broken link removed**

By the way, the DTMF tones in the wav file are 201020. I did this in MATLAB:

x = wavread('batandsplab.wav');
specgram(x, 512, 8000, hamming(512), 500);
colormap(bone.^4); ylim([0 2000]);

Code:
          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    |    #    |
        |_ _ _ _ __ _ _ _ __ _ _ _ _ _|
 

fft in matlab of wav file

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.

Where is the source code?
 

specgram wav file matlab

Please I have the same problem but I need it in LabVIEW
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top