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.

how to Plot wav file in Matlab

Status
Not open for further replies.

munaza

Newbie level 4
Joined
Sep 14, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,335
Hi
i am new to Matlab. I want to plot frequency and magnitude of .wav file after filtering it upto 7khz .please tel me what code of Matlab will do this task. thanks
 

let ur .wav file is road
[road,fs]=wavread('road.wav');
sound(road,fs);
right=road:),2); %right is 2nd column of road
time=(1/fs); %1/fs * length(right)
t=linspace(0,time,length(right)); %generates a row vector t of 'no. of elements in column 2 i.e right' points linearly spaced between and including 0 and time
plot(t,right)
xlabel('time (sec)');
ylabel('relative signal strength');
 

let ur .wav file is road
[road,fs]=wavread('road.wav'); [ mention fs= 7000hz]

sound(road,fs);
right=road:),2); %right is 2nd column of road
time=(1/fs); %1/fs * length(right)
t=linspace(0,time,length(right)); %generates a row vector t of 'no. of elements in column 2 i.e right' points linearly spaced between and including 0 and time
plot(t,right)
xlabel('time (sec)');
ylabel('relative signal strength');
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top