All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-13-2012, 03:19 PM
panic mode's Avatar
panic mode panic mode is offline
Senior Member
 
Join Date: Oct 2011
Location: Mississauga, Ontario
Posts: 1,095
Default Matlab Error ...

got PM from m_arezoo

Quote:
hi
i use your matlab code to read audio file but also it has an error, please help me

Code:
[signal, Fs, bits_per_sample]=wavread('C:\Users\hp\Desktop\abc.wav');

L=length(signal); % file length
T=1/Fs; % sample period
t=[0:L-1]*T; % time vector in seconds

% define echo and amplitude values
Te=40; % set echo to 300 ms 
alpha = 0.9; % scale amplitude of echo
DelaySec = round(Te / 1000); % must be integer
te = round(DelaySec / T); % echo delay as integer (rel. to sample period)

signalplusecho=1:L+te; % declare it as vector before loop
for t = 1:L+te
if (t<te) 
signalplusecho(t)=signal(t);
elseif (t>=L) 
signalplusecho(t)=signal(t-te);
else 
signalplusecho(t)=signal(t) + alpha*signal(t+te);
end
end

wavwrite(signalplusecho,Fs,8, 'speechwithecho.wav');
Select All
??? Error using ==> wavread at 166
Invalid field name: ''.
Error in ==> read at 4
[signal, Fs, bits_per_sample]=wavread('C:\Users\hp\Desktop\abc.wav');
dear m_arezoo, please do not use PM for non-personal matter. I assure you that program is working fine on my machine.

do you understand what error tells you?

are you sure your user account on your pc is called HP and not m_arezoo or something similar?

C:\Users\hp\Desktop\abc.wav

are you sure that entire path and file name are correct?
Reply With Quote
Reply   Post New Thread

Tags
,


Related Site Pages
Section Title
Worksheet Mixed-frequency signals
Textbook Quantum physics : Solid-state Device Theory


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matlab basic plot, gives error hopelft Programmer's Corner 2 03-07-2012 10:16 PM
PIC Microcontrollers - Getting Started (again) SubnetMask Embedded Systems and Microcontrollers 16 11-23-2010 07:30 PM
[URGENT] HELP NEEDED FOR CLASS IN C++ NiCeBoY Programmer's Corner 3 06-04-2009 06:14 AM
Useful Matlab Information Dave Programmer's Corner 7 11-09-2008 05:51 AM
GUI project in mat lab m75allen Programmer's Corner 6 05-30-2007 11:51 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:20 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.