A sound produced by a musical instrument can be explained using the ADSR model, which involves 4 stages:
attack
decay
sustain
release
Information about Electrical, Electronic, Communication and Computer Engineering 電機、電子、通訊、電腦資訊工程的學習筆記
相關資訊~生醫工程:StudyBME
聽力科技相關資訊:電子耳資訊小站
iOS程式語言:Study Swift
樹莓派和Python:Study Raspberry Pi
2017/03/18
2017/03/13
Matlab: Length and Size of a Vector/Matrix
Given that
>> a = [1 2 3;4 5 6]
>> b = 1:5
Length
>> length(a)
ans =
3
>> length(b)
ans =
5
Size
>> size(a)
ans =
2 3
>> size(b)
ans =
1 5
>> a = [1 2 3;4 5 6]
>> b = 1:5
>> length(a)
ans =
3
>> length(b)
ans =
5
Size
>> size(a)
ans =
2 3
>> size(b)
ans =
1 5
Matlab: How to use Quantiz with partition and codebook
The Quantiz function requires the Communications System Toolbox.
This quantization function requires at least an input signal and a partition vector.
Partition
The example below shows an input signal between 1 and 10. The partition vector equals [2 5 7]. When the signal is quantized, values become:
y = 0 if x <= 2
y = 1 if x <= 5
y = 2 if x <= 7
y = 3 if x > 7
>> x = 1:10
x =
1 2 3 4 5 6 7 8 9 10
>> partition = [2 5 7]
partition =
2 5 7
>> y = quantiz(x, partition)
y =
0 0 1 1 1 2 2 3 3 3
Codebook
Using the same input signal x and partition above, add a codebook as:
>> codebook = [-4 0 2 4]
Insert the codebook as the third parameter in the Quantiz function. The index and quantized value quants are output:
>> [index,quants] = quantiz(x,partition,codebook)
index =
0 0 1 1 1 2 2 3 3 3
quants =
-4 -4 0 0 0 2 2 4 4 4
Reference
Quantization (MathWorks)
This quantization function requires at least an input signal and a partition vector.
Partition
The example below shows an input signal between 1 and 10. The partition vector equals [2 5 7]. When the signal is quantized, values become:
y = 0 if x <= 2
y = 1 if x <= 5
y = 2 if x <= 7
y = 3 if x > 7
>> x = 1:10
x =
1 2 3 4 5 6 7 8 9 10
>> partition = [2 5 7]
partition =
2 5 7
>> y = quantiz(x, partition)
y =
0 0 1 1 1 2 2 3 3 3
Codebook
Using the same input signal x and partition above, add a codebook as:
>> codebook = [-4 0 2 4]
Insert the codebook as the third parameter in the Quantiz function. The index and quantized value quants are output:
>> [index,quants] = quantiz(x,partition,codebook)
index =
0 0 1 1 1 2 2 3 3 3
quants =
-4 -4 0 0 0 2 2 4 4 4
Reference
Quantization (MathWorks)
2017/03/12
PCM, DPCM, ADPCM
訂閱:
文章 (Atom)