ls *wav
1860v2.wav
2600Hz.wav
Tritones.wav
bach2.wav
bad_sierpinski_round_ambient.wav
buzz_44100.wav
buzz_8000.wav
complex_sound.wav
ee.wav
flute.wav
hello.wav
hello2.wav
myKSAlgo71pct.wav
ndb_bach_adagio.wav
piano1.wav
piano2.wav
pop.wav
rappin.wav
sh.wav
she.wav
sierpinski_round2.wav
sierpinski_round_ambient.wav
snap.wav
squeak.wav
squeak2.wav
squeaky_chair.wav
sweep_44100.wav
sweep_8000.wav
teenbuzz17400.wav
test_file.wav
violin.wav
help wavread
wavread Read Microsoft WAVE (".wav") sound file.
wavread will be removed in a future release. Use AUDIOREAD instead.
Y=wavread(FILE) reads a WAVE file specified by the string FILE,
returning the sampled data in Y. The ".wav" extension is appended
if no extension is given.
[Y,FS,NBITS]=wavread(FILE) returns the sample rate (FS) in Hertz
and the number of bits per sample (NBITS) used to encode the
data in the file.
[...]=wavread(FILE,N) returns only the first N samples from each
channel in the file.
[...]=wavread(FILE,[N1 N2]) returns only samples N1 through N2 from
each channel in the file.
[Y,...]=wavread(...,FMT) specifies the data type format of Y used
to represent samples read from the file.
If FMT='double', Y contains double-precision normalized samples.
If FMT='native', Y contains samples in the native data type
found in the file. Interpretation of FMT is case-insensitive,
and partial matching is supported. If omitted, FMT='double'.
SIZ=wavread(FILE,'size') returns the size of the audio data contained
in the file in place of the actual audio data, returning the
2-element vector SIZ=[samples channels].
[Y,FS,NBITS,OPTS]=wavread(...) returns a structure OPTS of additional
information contained in the WAV file. The content of this
structure differs from file to file. Typical structure fields
include '.fmt' (audio format information) and '.info' (text
which may describe title, author, etc.)
Output Scaling
The range of values in Y depends on the data format FMT specified.
Some examples of output scaling based on typical bit-widths found
in a WAV file are given below for both 'double' and 'native' formats.
FMT='native'
#Bits MATLAB data type Data range
----- ------------------------- -------------------
8 uint8 (unsigned integer) 0 <= Y <= 255
16 int16 (signed integer) -32768 <= Y <= +32767
24 int32 (signed integer) -2^23 <= Y <= 2^23-1
32 single (floating point) -1.0 <= Y <= +1.0
FMT='double'
#Bits MATLAB data type Data range
----- ------------------------- -------------------
N<32 double -1.0 <= Y < +1.0
N=32 double -1.0 <= Y <= +1.0
Note: Values in y might exceed -1.0 or +1.0 for the case of
N=32 bit data samples stored in the WAV file.
Supports multi-channel data, with up to 32 bits per sample.
Supports Microsoft PCM data format only.
See also audioread, audiowrite, audioinfo.
Reference page in Help browser
doc wavread
[x, fs, b] = wavread('1860v2.wav');
[Warning: WAVREAD will be removed in a future release. Use
AUDIOREAD instead.]
[> In wavread at 62]
fs
fs =
44100
b
b =
16
plot(x)
whos
Name Size Bytes Class Attributes
b 1x1 8 double
fs 1x1 8 double
x 490223x1 3921784 double [x, fs, b] = wavread('1860v2.wav');
[Warning: WAVREAD will be removed in a future release. Use
AUDIOREAD instead.]
[> In wavread at 62]
sound(x,fs)
ls *.wav
1860v2.wav
2600Hz.wav
Tritones.wav
bach2.wav
bad_sierpinski_round_ambient.wav
buzz_44100.wav
buzz_8000.wav
complex_sound.wav
ee.wav
flute.wav
hello.wav
hello2.wav
myKSAlgo71pct.wav
ndb_bach_adagio.wav
piano1.wav
piano2.wav
pop.wav
rappin.wav
sh.wav
she.wav
sierpinski_round2.wav
sierpinski_round_ambient.wav
snap.wav
squeak.wav
squeak2.wav
squeaky_chair.wav
sweep_44100.wav
sweep_8000.wav
teenbuzz17400.wav
test_file.wav
violin.wav
[x, fs, b] = wavread('bach2.wav');
[Warning: WAVREAD will be removed in a future release. Use
AUDIOREAD instead.]
[> In wavread at 62]
fs
fs =
11025
sound(x,fs)
whos
Name Size Bytes Class Attributes
b 1x1 8 double
fs 1x1 8 double
x 181664x1 1453312 double
sound(x,fs*2)
sound(x,round(fs/2))
% fft and ifft
% AGAGA
% user looks for AGA
% 2 matches in AGAGA
load('genetic.mat');
whos
Name Size Bytes Class Attributes
b 1x1 8 double
data 1x4723 9446 char
fs 1x1 8 double
x 181664x1 1453312 double
d = data(1:20)
d =
ggggggctgcgcggccgggt
% look at a small amount of data to get going
% work with upper or lower case
ch = 'Z';
clear
load('genetic.mat');
ch = 'Z';
disp(' ');
disp(' ');
disp(' ');
disp(' ');
disp('A');
A
disp('a');
a
disp('1');
1
clc
if ((ch == 'A'))
disp('A');
end
if ((ch >= 'A') && (ch <='Z'))
disp('A to Z')p
disp('A to Z')p
|
{Error: Unexpected MATLAB expression.
}
if ((ch >= 'A') && (ch <='Z'))
disp('A to Z');
end
A to Z
% ch is uppercase
diary off