请问MATLAB中的wavwriteexcel中len函数的用法怎么用?

Write audio file
Syntaxaudiowrite(filename,y,Fs) audiowrite(filename,y,Fs,Name,Value) Descriptionaudiowrite(,,) writes
a matrix of audio data, y, with sample rate Fs to
a file called filename. The filename input
also specifies the output file format. The
depends on the output
file format and the data type of the audio data, y.audiowrite(,,,) uses
additional options specified by one or more Name,Value pair
arguments.Examples
Create a WAVE file from the example file handel.mat,
and read the file back into MATLAB®.
Write a WAVE (.wav) file in the current
folder.load handel.mat
filename = 'handel.wav';
audiowrite(filename,y,Fs);
clear y FsRead the data back into MATLAB using audioread.[y,Fs] = audioread(filename);Listen to the audio.sound(y,Fs);
Create a FLAC file from the example file handel.mat and
specify the number of output bits per sample and a comment.load handel.mat
filename = 'handel.flac';
audiowrite(filename,y,Fs,'BitsPerSample',24,'Comment','This is my new audio file.');
clear y FsView information about the new FLAC file.info = audioinfo(filename)info =
Filename: 'S:\handel.flac'
CompressionMethod: 'FLAC'
NumChannels: 1
SampleRate: 8192
TotalSamples: 73113
Duration: 8.9249
Comment: 'This is my new audio file.'
Artist: []
BitsPerSample: 24
Input Argumentsstring
Name of file to write, or the full path to the file, specified
as a string that includes the file extension.
If a path is specified,
it can be absolute or relative. If you do not specify the path, then
the destination directory is the current working directory.
audiowrite supports the following file formats.
Platform SupportFile Format
All platformsWAVE (.wav)
OGG (.ogg)
FLAC (.flac)
Windows® and MacMPEG-4 AAC (.m4a, .mp4)
Example: 'myFile.m4a'
Example: '../myFile.m4a'
Example: 'C:\temp\myFile.m4a'
When writing AAC files on Windows, audiowrite pads
the front and back of the output signal with extra samples of silence.
The Windows AAC encoder also places a very sharp fade-in and
fade-out on the audio.
This results in audio with an increased number
of samples after being written to disk.
Audio data to write, specified as an m-by-n matrix,
where m is the number of audio samples to write
and n is the number of audio channels to write.
If either m or n is 1,
then audiowrite assumes that this dimension specifies
the number of audio channels, and the other dimension specifies the
number of audio samples.
The maximum number of channels depends on the file format.
File FormatMaximum
Number of Channels
WAVE (.wav)256
OGG (.ogg)255
FLAC (.flac)8
MPEG-4 AAC (.m4a, .mp4)2
The valid range for the data in y depends
on the data type of y.
Data Type of yValid
Range for y
uint80 ≤ y &#
int16-32768 ≤ y ≤ +32767
int32-2^32 ≤ y &#–1
single-1.0 ≤ y ≤ +1.0
double-1.0 ≤ y ≤ +1.0
Data beyond the valid range is clipped.
If y is single or double,
then audio data in y should be normalized to values
in the range &# and 1.0, inclusive.
Data Types: single | double | int16 | int32 | uint8positive scalar
Sample rate, in hertz, of audio data y, specified
as a positive scalar greater than 0. Values of Fs are
truncated to integer boundaries. When writing to .m4a or .mp4 files
on Windows platforms, audiowrite supports
only samples rates of 44100 and 48000.
Example: 44100Data Types: doubleName-Value Pair ArgumentsSpecify optional comma-separated pairs of Name,Value arguments.
Name is the argument
name and Value is the corresponding
value. Name must appear
inside single quotes (' ').
You can specify several name and value pair
arguments in any order as Name1,Value1,...,NameN,ValueN.Example: 'Title','Symphony No. 9','Artist','My Orchestra' instructs audiowrite to
write an audio file with the title "Symphony No. 9"
and the artist information "My Orchestra."16 (default) | 8 | 24 | 32 | 64
Number of output bits per sample, specified as the comma-separated
pair consisting of 'BitsPerSample' and a number.
Only available for WAVE (.wav) and FLAC (.flac)
files. For FLAC files, only 8, 16, or 24 bits per sample are supported.
Example: 'BitsPerSample',32
128 (default) | 64 | 96 | 160 | 192 | 256 | 320
Number of kilobits per second (kbit/s) used for compressed audio
files, specified as the comma-separated pair consisting of 'BitRate' and
an integer. Noninteger values are truncated. On Windows 7 platforms,
the only valid values are 96, 128, 160, and 192.
In general, a larger BitRate value results
in higher compression quality.
Only available for MPEG-4 (.m4a, .mp4)
Example: 'BitRate',96
(default) | value in the range [0 100]
Quality setting for the Ogg Vorbis Compressor, specified as
the comma-separated pair consisting of 'Quality' and
a number in the range [0 100], where 0 is lower quality and higher
compression, and 100 is higher quality and lower compression.
Only available for OGG (.ogg) files.
Example: 'Quality',25
[] (default) | string
Title information, specified as the comma-separated pair consisting
of 'Title' and a string.
[] (default) | string
Artist information, specified as the comma-separated pair consisting
of 'Artist' and a string.
Additional information, specified as the comma-separated pair
consisting of 'Comment' and a string.
On Mac platforms, audiowrite writes
metadata to WAVE, OGG, and FLAC files only, and will not write the 'Title', 'Author',
or 'Comment' fields to MPEG-4 AAC files.More AboutThe output data type is determined by the file
format, the data type of y, and the specified output BitsPerSample.File FormatsData
Type of yOutput BitsPerSampleOutput Data Type
WAVE (.wav), uint8, int16, int32, single, double8uint8
uint8, int16, int3232int32
single, double32single
single, double64double
FLAC (.flac)uint8, int16, int32, single, double8int8
MPEG-4 (.m4a, .mp4), OGG (.ogg)uint8, int16, int32, single, doubleN/Asingle
See Also |
欢迎转载,转载请注明来自:
与matlab audiowrite用法相关的文章
版权归所有|
友链等可联系 |matlab中format函数使用方法_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
matlab中format函数使用方法
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
你可能喜欢matlab 读取处理 wav 文件 - CSDN博客
matlab 读取处理 wav 文件
最近工作需要,要对文件中存储的声音信息进行分析处理。所以花了些时间收集了各种数学软件中处理文件的方法。
Matlab&是最方便的。甚至于不用写任何代码就能读取&文件(我用的是)。在当前路径窗口中双击文件就自动将文件内容读入了。
图&1&当前路径窗口
双击后会自动弹出数据导入向导。data&中是波形文件(每一列对应一个声道),存的是采样率。这两个变量名都可以按照自己的需要来修改。
图&2&数据导入向导
相应的函数是&wavread()。&有下面的几种调用格式。
y = wavread('filename')
这是最简单的形式,将wav&文件中的波形数据读入&中,波形的幅度范围在。
[y,Fs,bits] = wavread('filename')Fs&存的是采样率,单位,是数据的位数。
[...] = wavread('filename',N)只读取前&N&个数据点。
[...] = wavread('filename',[N1 N2])只读取N1&到&之间的数据。
siz = wavread('filename','size')读取wav文件有多少数据点,siz&为一个行两列的向量。siz&=&[samples&channels]
wavfinfo()&用来获取文件的信息。
[m d] = wavfinfo(filename)当&filename&是文件时&返回字符串'Sound&(WAV)&file',否则返回空字符串。
d&返回包含新的字符串,比如像这里给出的结果:’Sound&(WAV)&file&containing:&41532&samples&in&1&channel(s)’,如果不是文件,则返回字符串'Not&a&WAVE&file'。
wavwrite&函数可以生成一个&文件,有三种基本的调用格式。
wavwrite(y,'filename')将&y&中的数据写入文件,其中的每一列对应一个声道。要求&中的数据在&。超出这个范围的都被截断。采样率默认为&。位格式。
wavwrite(y,Fs,'filename')Fs&用来设定采样率。
wavwrite(y,Fs,N,'filename')N&指定数据的位数,可以为&、、和。当&!时,文件按照码来存储。当时,数据按照浮点数格式存储。这时也就不要求数据范围在到之间了。
本文已收录于以下专栏:
相关文章推荐
MATLAB 与 音频处理 相关内容摘记
MATLAB 与 音频处理 相关内容摘记 1
MATLAB 音频相关函数 1
MATLAB 处理音频信号...
本文介绍了语音处理中常用到的语音特征的生物和物理含义,并给出了提取方法,主要包括响度,音高,基频,MFCC,共振峰,声门波,短时能量,过零率,短时幅度,语速,停顿,等等
原文地址:MATLAB读取音频文件并进行音频特征提取 作者:愚人
语音信号处理MFCC提取的Matlab源码,
Matlab调试运行的时候注意添加语音工具箱voicebox查找路径。即,
Matlab:File-&Set Path…-&Add Folder… 选...
最近工作需要,要对wav文件中存储的声音信息进行分析处理。所以花了些时间收集了各种数学软件中处理wav 文件的方法。
Matlab 是最方便的。甚至于不用写任何代码就能读...
听听函数,看看声音--Matlab的sound()函数
%读一个文件夹中的多个wav文件,然后拼接在一起
folder = 'D:/FFOutput/xiami/';
files = dir([folder '*.w...
sound函数用法sound(y)
sound(y, Fs)
sound(y, Fs, nBits)y为音频信号矩阵, Fs为采样率,即单位时间的样本个数(Hz),nBits表示每个样本点用几个比...
他的最新文章
讲师:吴岸城
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)

我要回帖

更多关于 matlab中fill函数用法 的文章

 

随机推荐