等差數列/算數數列 arithmetic sequence/arithmetic progression 1,3,5,7...
等差級數/算數級數 arithmetic series 1+3+5+7+...
等差級數和:
n(a1 + an)/2
1+3+5+7+9 = 5×(1+9)/2 = 25
等比數列/幾合數列 geometric sequence/geometric progression 1,2,4,8...
等比級數/幾合級數 geometric series 1+2+4+8+...
等比級數和:
a(1-rn)/(1-r) = a(rn-1)/(r-1)
1+2+4+8+16 = 1×(1-25)/(1-2) = 1×(25-1)/(2-1) = 1×(32-1)/(2-1) = 31
公差 common difference
公比 common ratio
參考資料
https://en.wikipedia.org/wiki/Arithmetic_progression
https://en.wikipedia.org/wiki/Geometric_progression
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網
Information about Electrical, Electronic, Communication and Computer Engineering 電機、電子、通訊、電腦資訊工程的學習筆記
相關資訊~生醫工程:StudyBME
聽力科技相關資訊:電子耳資訊小站
iOS程式語言:Study Swift
樹莓派和Python:Study Raspberry Pi
2016/12/24
2016/11/26
Matlab: My First Time with Simulink 第一次接觸Simulink
一直不太了解Simulink是什麼
今天第一次玩玩
過程如下:
Below are instructions of a simple Simulink example for beginners. (Just like a "Hello World" in learning a new programming language.)
1. Enter the following command in Matlab:
>> simulink
After a while, the Simulink Library Browser is opened automatically.
2. Select File -> New ->Model and an "untitled" window is opened.
3. Search for "Sine Wave" and "Scope" in Simulink Library Browser and drag them into the "untitled" window. (Don't select Sine or Sine Wave Function.)
4. Connect "Sine Wave" to "Scope".
5. Double click "Scope" to open the waveform.
6. Double click "Sine Wave" to adjust the amplitude and frequency.
7. Press the ▻ button to start simulation.
Result:
Related Information:
Matlab: Draw a Sine curve with sind()
今天第一次玩玩
過程如下:
Below are instructions of a simple Simulink example for beginners. (Just like a "Hello World" in learning a new programming language.)
1. Enter the following command in Matlab:
>> simulink
After a while, the Simulink Library Browser is opened automatically.
2. Select File -> New ->Model and an "untitled" window is opened.
3. Search for "Sine Wave" and "Scope" in Simulink Library Browser and drag them into the "untitled" window. (Don't select Sine or Sine Wave Function.)
4. Connect "Sine Wave" to "Scope".
5. Double click "Scope" to open the waveform.
6. Double click "Sine Wave" to adjust the amplitude and frequency.
7. Press the ▻ button to start simulation.
Result:
Related Information:
Matlab: Draw a Sine curve with sind()
2016/11/22
Negative and Reciprocal Inequalities 負數及倒數的不等式運算規則
要理解負數及倒數的不等式運算規則
其實很簡單:
Negative Number 負數:
if a < b, then -a > -b
e.g. 3 < 5 ==> -3 > -5
Reciprocal/Multiplicative Inverse 倒數:
if a < b, then 1/a > 1/b
e.g. 3 < 5 ==> 1/3 > 1/5
Reference 參考資料:
Properties of Inequalities
其實很簡單:
Negative Number 負數:
if a < b, then -a > -b
e.g. 3 < 5 ==> -3 > -5
Reciprocal/Multiplicative Inverse 倒數:
if a < b, then 1/a > 1/b
e.g. 3 < 5 ==> 1/3 > 1/5
Reference 參考資料:
Properties of Inequalities
2016/11/14
Voltage Divider/Potential Divider 分壓器
voltage divider/potential divider 分壓器
How to get the voltage output of a voltage divider?
Answer:
Vin ---- Z1 ----- Vout ----- Z2 ---- GND
i = Vin / (Z1 + Z2) = Vout / Z2
=> Vout = [Z2 / (Z1 + Z2)]Vin
where Z can be resistor/capacitor/inductor.
Reference:
Voltage Divider (Wikipedia)
How to get the voltage output of a voltage divider?
Answer:
Vin ---- Z1 ----- Vout ----- Z2 ---- GND
i = Vin / (Z1 + Z2) = Vout / Z2
=> Vout = [Z2 / (Z1 + Z2)]Vin
where Z can be resistor/capacitor/inductor.
Reference:
Voltage Divider (Wikipedia)
Inverting Amplifier 反相放大器
inverting amplifier 反相放大器
Vin ---- Rin ----- Vmid ----- Rf ---- Vout
Vmid ----- -ve of op-amp
GND ----- +ve of op-amp
What's Vout?
Answer:
Vmid = 0 for an ideal op-amp.
i = Vin / Rin = - Vout / Rf
=> Vout = - (Rf / Rin)Vin
What's the voltage gain?
Answer:
Gain = Vout / Vin = - (Rf / Rin)
Vin ---- Rin ----- Vmid ----- Rf ---- Vout
Vmid ----- -ve of op-amp
GND ----- +ve of op-amp
What's Vout?
Answer:
Vmid = 0 for an ideal op-amp.
i = Vin / Rin = - Vout / Rf
=> Vout = - (Rf / Rin)Vin
What's the voltage gain?
Answer:
Gain = Vout / Vin = - (Rf / Rin)
2016/11/08
convolution and DSP
convolution 摺積/捲積/疊積/旋積
convolution theorem 捲積定理
input: x[n]
system: h[n]
output: y[n]
convolution in time domain = multiplication in frequency domain
Time Domain:
y(n) = h(n) * x(n) = Σ h(k)x(n-k) where k ∈ Z (Z: integers 整數 ... -3, -2, -1, 0, 1, 2, 3, ...)
Frequency Domain:
Y(k) = H(k)X(k)
相關資料
Convolution (Wikipedia) / 摺積 (維基百科)
Video: Introduction to the convolution (Khan Academy 可汗學院)
Meaning of R, Q, Z, and N characters in math 數學中R, Q, Z, N的意義
convolution theorem 捲積定理
input: x[n]
system: h[n]
output: y[n]
convolution in time domain = multiplication in frequency domain
Time Domain:
y(n) = h(n) * x(n) = Σ h(k)x(n-k) where k ∈ Z (Z: integers 整數 ... -3, -2, -1, 0, 1, 2, 3, ...)
Frequency Domain:
Y(k) = H(k)X(k)
相關資料
Convolution (Wikipedia) / 摺積 (維基百科)
Video: Introduction to the convolution (Khan Academy 可汗學院)
Meaning of R, Q, Z, and N characters in math 數學中R, Q, Z, N的意義
Meaning of R, Q, Z, and N characters in math 數學中R, Q, Z, N的意義
R - real numbers 實數 -∞ ~ ∞, no imaginary part i 不含虛部 i
Q - rational numbers 有理數 may be represented as a ratio of p/q, where q ≠ 0.
Z - integers 整數 ... -3, -2, -1, 0, 1, 2, 3, ...
N - natural numbers 自然數 1, 2, 3, 4, ...
R 包含了 Q
Q 包含了 Z
Z 包含了 N
Figure of R, Q, Z, and N relationship
Example:
point sampling
x[n] = x(nT), n ∈ Z
n 屬於整數
參考資料
https://en.wikipedia.org/wiki/Rational_number#/media/File:Number-systems.svg
Q - rational numbers 有理數 may be represented as a ratio of p/q, where q ≠ 0.
Z - integers 整數 ... -3, -2, -1, 0, 1, 2, 3, ...
N - natural numbers 自然數 1, 2, 3, 4, ...
R 包含了 Q
Q 包含了 Z
Z 包含了 N
Figure of R, Q, Z, and N relationship
Example:
point sampling
x[n] = x(nT), n ∈ Z
n 屬於整數
參考資料
https://en.wikipedia.org/wiki/Rational_number#/media/File:Number-systems.svg
2016/11/05
Fourier Analysis Terms 傅立葉分析相關名詞
Joseph Fourier (1768-1830) - French mathematician and physicist
Fourier analysis 傅立葉分析 function ---decompose---> oscillatory components
Fourier synthesis 傅立葉合成 oscillatory components ---combine--> function
Trigonometric series 三角級數 (Wikipedia)
Fourier series 傅立葉級數 => 可表示週期函數
Fourier transform 傅立葉轉換
discrete-time Fourier transform (DTFT) 離散時間傅立葉轉換
discrete Fourier transform (DFT) 離散傅立葉轉換
Fourier series:
periodic function 週期函數
f(x) = f(x + t) where t is the period
fundamental period 基本周期 t
fundamental frequency 基本頻率/基頻 f = 1/t
fundamental angular frequency 基本頻率/基頻 ω0 = 2πf = 2π/t
fast Fourier transform (FFT) 快速傅立葉轉換
Periodic function => Fourier series
Non-periodic function => Fourier transform
Discrete function => discrete Fourier transform
periodic signal representations:
1. sin + cos functions
2. amplitude + phase
3. complex Fourier series
Harmonic 諧波
Harmonic series 諧波列/泛音列
Overtone 泛音
analytic signal 解析訊號
Reference
Fourier analysis (Wikipedia)
Advanced Engineering Mathematics (10th edition), p474
Engineering Mathematics Exposed page 503
Fourier analysis 傅立葉分析 function ---decompose---> oscillatory components
Fourier synthesis 傅立葉合成 oscillatory components ---combine--> function
Trigonometric series 三角級數 (Wikipedia)
Fourier series 傅立葉級數 => 可表示週期函數
Fourier transform 傅立葉轉換
discrete-time Fourier transform (DTFT) 離散時間傅立葉轉換
discrete Fourier transform (DFT) 離散傅立葉轉換
Fourier series:
periodic function 週期函數
f(x) = f(x + t) where t is the period
fundamental period 基本周期 t
fundamental frequency 基本頻率/基頻 f = 1/t
fundamental angular frequency 基本頻率/基頻 ω0 = 2πf = 2π/t
Periodic function => Fourier series
Non-periodic function => Fourier transform
Discrete function => discrete Fourier transform
periodic signal representations:
1. sin + cos functions
2. amplitude + phase
3. complex Fourier series
Harmonic 諧波
Harmonic series 諧波列/泛音列
Overtone 泛音
analytic signal 解析訊號
Reference
Fourier analysis (Wikipedia)
Advanced Engineering Mathematics (10th edition), p474
Engineering Mathematics Exposed page 503
2016/11/04
Matlab: Custom Function 自定函數
To create a custom function, the function name has to be identical to the *.m file name. (函數名稱必須與m檔案的名稱一致。)
Create a new script and edit it as:
Save the script as MyFunctionName.m.
If a custom function is not properly defined or the path is incorrect, Matlab may return an error like this:
Undefined function or variable 'MyFunctionName'.
Hot to set the path for M files:
Home -> Environment -> Set Path
Example of Matlab 2015 b (Mac):
Call the M file from the Matlab terminal:
>> MyFunctionName(2,3)
ans =
6
==============
Example to return multiple vectors with unequal dimensions:
function [a, b] = MyFunc(in1, in2)
a = [in1;1;2];
b = [in2 in2*2 in2*3 in2*4];
Save the code above as MyFunc.m.
Execute the function as below:
>> [a, b] = MyFunc(1,2)
a =
1
1
2
b =
2 4 6 8
Related Information 參考資料
Common Errors When Calling Functions (MathWorks)
Create a new script and edit it as:
function outputName = MyFunctionName(a,b)
% This function muliplies a by b and returns the result as outputName
outputName = a*b;
Save the script as MyFunctionName.m.
If a custom function is not properly defined or the path is incorrect, Matlab may return an error like this:
Undefined function or variable 'MyFunctionName'.
Hot to set the path for M files:
Home -> Environment -> Set Path
Example of Matlab 2015 b (Mac):
Call the M file from the Matlab terminal:
>> MyFunctionName(2,3)
ans =
6
==============
Example to return multiple vectors with unequal dimensions:
function [a, b] = MyFunc(in1, in2)
a = [in1;1;2];
b = [in2 in2*2 in2*3 in2*4];
Save the code above as MyFunc.m.
Execute the function as below:
>> [a, b] = MyFunc(1,2)
a =
1
1
2
b =
2 4 6 8
Related Information 參考資料
Common Errors When Calling Functions (MathWorks)
2016/11/02
Matlab: Draw an Exponential Function with exp() with a custom Y-axis at x = 0
>> x = -2:0.2:4; %incrementing by 0.2 from -2 to 4.
>> y = exp(x);
>> plot(x,y);
>> ax = gca; %Axis
>> ax.YAxisLocation = 'origin'; %Y axis at x = 0.
>> title('Exponential Function', 'FontSize', 16); %Add title to plot with custom font size
Result:
Related Information:
Exponential Function & Natural Logarithm 指數函數與自然對數
Display Axis Lines Through Origin (MathWorks)
>> y = exp(x);
>> plot(x,y);
>> ax = gca; %Axis
>> ax.YAxisLocation = 'origin'; %Y axis at x = 0.
>> title('Exponential Function', 'FontSize', 16); %Add title to plot with custom font size
Result:
Related Information:
Exponential Function & Natural Logarithm 指數函數與自然對數
Display Axis Lines Through Origin (MathWorks)
2016/10/29
Sinc Function / Sampling Function 取樣函數
There are two definitions for the Sinc function:
When x ≠ 0,
for mathematics,
sinc(x) = sin(x)/x (unnormalized sinc function)
for digital signal processing,
sinc(x) = sin(πx)/πx (normalized sinc function)
When x = 0,
sinc(x) = sinc(0) = 1 for both mathematics and DSP.
In DSP, sinc(x) is also called the sampling function:
Sa(πx) = sin(πx)/πx = sinc(x)
When x ≠ 0,
for mathematics,
sinc(x) = sin(x)/x (unnormalized sinc function)
for digital signal processing,
sinc(x) = sin(πx)/πx (normalized sinc function)
When x = 0,
sinc(x) = sinc(0) = 1 for both mathematics and DSP.
In DSP, sinc(x) is also called the sampling function:
Sa(πx) = sin(πx)/πx = sinc(x)
Euler's formula 歐拉公式
Leonhard Euler (1707-1783) 瑞士數學家
Euler 歐拉/尤拉
Euler's formula helps to find the exponential function of a complex number.
Euler's formula 歐拉公式:
ejx = cosx + isinx = cisx
Therefore,
eiθ = cosθ + isinθ (1)
e-iθ = cos(-θ) + isin(-θ) = cosθ - isinθ (2)
(1) + (2) gives
=> eiθ + e-iθ = 2cosθ
=> cosθ = ( eiθ + e-iθ )/2
(1) - (2) gives
=> ejθ - e-jθ = 2isinθ
=> sinθ = ( eiθ - e-iθ )/2i
cosθ = Re(eiθ) =( eiθ + e-iθ )/2
sinθ = Im(eiθ) =( eiθ - e-iθ )/2i
Example:
ei = cos(1) + isin(1) = 0.540302306 + 0.841470985i
eiπ = cos(π) + isin(π) = -1 => eiπ + 1 = 0
Matlab function:
exp(i*pi) or exp(j*pi)
參考資料
cis (mathematics) (Wikipedia)
Relations between cosine, sine and exponential functions
Exponential function & natural logarithm 指數函數與自然對數
Magnitude of Exponential Function exp(iθ) = ? 如何求exp(iθ)的大小/絕對值
Euler 歐拉/尤拉
Euler's formula helps to find the exponential function of a complex number.
Euler's formula 歐拉公式:
ejx = cosx + isinx = cisx
Therefore,
eiθ = cosθ + isinθ (1)
e-iθ = cos(-θ) + isin(-θ) = cosθ - isinθ (2)
(1) + (2) gives
=> eiθ + e-iθ = 2cosθ
=> cosθ = ( eiθ + e-iθ )/2
(1) - (2) gives
=> ejθ - e-jθ = 2isinθ
=> sinθ = ( eiθ - e-iθ )/2i
cosθ = Re(eiθ) =( eiθ + e-iθ )/2
sinθ = Im(eiθ) =( eiθ - e-iθ )/2i
Example:
ei = cos(1) + isin(1) = 0.540302306 + 0.841470985i
eiπ = cos(π) + isin(π) = -1 => eiπ + 1 = 0
Matlab function:
exp(i*pi) or exp(j*pi)
參考資料
cis (mathematics) (Wikipedia)
Relations between cosine, sine and exponential functions
Exponential function & natural logarithm 指數函數與自然對數
Magnitude of Exponential Function exp(iθ) = ? 如何求exp(iθ)的大小/絕對值
2016/10/26
Exponential Function & Natural Logarithm 指數函數與自然對數
exp(x) = ex
some coordinates:
(0, 1)
(1, e)
Differentiation 微分 :
d(ex)/dx = ex
d(eax)/dx = aeax
Integration 積分 :
∫ ex dx = ex + c
∫ eax dx = (1/a)eax + c
Maclaurin Series:
ex = 1 + x + x2/2! + x3/3! + ... + xn/n!
ea+b = eaeb
(ea)b = eab
ea+bi = eaebi = ea(cosb + isinb) = eacis(b) (Euler's formula)
Inverse of ex:
ln(x)
natural logarithm 自然對數
loge(x) = ln(x)
derivative 導數:
d[ln(x)]/dx = 1/x
Exponential Function plotted by Matlab:
相關資料
Exponential Function (Wikipedia)
Matlab: Draw an Exponential Function with exp() with a custom Y-axis at x = 0
some coordinates:
(0, 1)
(1, e)
Differentiation 微分 :
d(ex)/dx = ex
d(eax)/dx = aeax
Integration 積分 :
∫ ex dx = ex + c
∫ eax dx = (1/a)eax + c
Maclaurin Series:
ex = 1 + x + x2/2! + x3/3! + ... + xn/n!
ea+b = eaeb
(ea)b = eab
ea+bi = eaebi = ea(cosb + isinb) = eacis(b) (Euler's formula)
Inverse of ex:
ln(x)
natural logarithm 自然對數
loge(x) = ln(x)
derivative 導數:
d[ln(x)]/dx = 1/x
Exponential Function plotted by Matlab:
相關資料
Exponential Function (Wikipedia)
Matlab: Draw an Exponential Function with exp() with a custom Y-axis at x = 0
2016/10/25
DSP terms 數位訊號處理基本名詞
digital signal processing 數位訊號處理/數位信號處理
sampling 取樣
quantization 量化
reconstruction 重建
point sampling 點取樣
impulse sampling 脈衝取樣
aliasing 頻疊、混疊
Nyquist frequency 奈奎斯特頻率
zero crossing 零交叉 - 訊號剛好為零(由負到正或由正到負的瞬間) (Wikipedia)
根據Wikipedia,計算zero crossing的數量可估計語音的fundamental frequency基頻
piecewise 分段
piecewise linear function 分段線性函數
sample and hold 取樣與保持
linear interpolation 線性內插
quantization step 量化間距/量化步階
quantization error 量化誤差
Signal-to-quantization-noise ratio (SQNR) 信號-量化雜訊比
SQNR = 6.02b + 1.76 dB 量化時每增加一個bit時,SQNR可提升6.02 dB (See Signal to quantization noise in quantized sinusoidal)
unit impulse 單位脈衝 δ[n] Dirac delta function 狄拉克δ函數
unit step 單位步階/單位階 u[n]
companding 壓擴/壓伸
time domain 時域
frequency domain 頻域
complex frequency domain 複數頻域
Fourier series 傅立葉級數
discrete Fourier transform (DFT) 離散傅立葉變換
fast Fourier transform (FFT) 快速傅立葉變換
discrete Cosine transform (DFT) 離散餘弦轉換
Z-transform Z 轉換
region of convergence (ROC) 收斂域
參考資料
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網
課程
DeltaMOOCx
sampling 取樣
quantization 量化
reconstruction 重建
point sampling 點取樣
impulse sampling 脈衝取樣
aliasing 頻疊、混疊
Nyquist frequency 奈奎斯特頻率
zero crossing 零交叉 - 訊號剛好為零(由負到正或由正到負的瞬間) (Wikipedia)
根據Wikipedia,計算zero crossing的數量可估計語音的fundamental frequency基頻
piecewise 分段
piecewise linear function 分段線性函數
sample and hold 取樣與保持
linear interpolation 線性內插
quantization step 量化間距/量化步階
quantization error 量化誤差
Signal-to-quantization-noise ratio (SQNR) 信號-量化雜訊比
SQNR = 6.02b + 1.76 dB 量化時每增加一個bit時,SQNR可提升6.02 dB (See Signal to quantization noise in quantized sinusoidal)
unit impulse 單位脈衝 δ[n] Dirac delta function 狄拉克δ函數
unit step 單位步階/單位階 u[n]
companding 壓擴/壓伸
time domain 時域
frequency domain 頻域
complex frequency domain 複數頻域
Fourier series 傅立葉級數
discrete Fourier transform (DFT) 離散傅立葉變換
fast Fourier transform (FFT) 快速傅立葉變換
discrete Cosine transform (DFT) 離散餘弦轉換
Z-transform Z 轉換
region of convergence (ROC) 收斂域
參考資料
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網
課程
DeltaMOOCx
2016/10/24
Matlab: Draw a Sine curve with sind()
To plot a sine wave between 0° and 360° in Matlab, simply use sind() in degrees:
>> x = 0:360;
>> y = sind(x);
>> plot(x,y)
Result:
If you want to draw sine waves in radians, use sin() instead. The website below shows how to use the sin() function and how to adjust axis ranges:
Set axis limits and aspect ratio (MathWorks)
You may also try the code below:
>> s = [0:.1:2*pi];
>> y = sin(s);
>> plot(s,y)
Related Information:
How to draw a sine wave with Simulink
>> x = 0:360;
>> y = sind(x);
>> plot(x,y)
Result:
If you want to draw sine waves in radians, use sin() instead. The website below shows how to use the sin() function and how to adjust axis ranges:
Set axis limits and aspect ratio (MathWorks)
You may also try the code below:
>> s = [0:.1:2*pi];
>> y = sin(s);
>> plot(s,y)
Related Information:
How to draw a sine wave with Simulink
2016/10/18
Complex Number & Complex Conjugate 複數、共軛複數
complex number 複數
complex plane 複數平面
real part 實部
imaginary part 虛部
z = a + bi
Re(z) = a
Im(z) = b
i2 = -1
-i = 1/i proof: -i = -i × i/i = -i2/i =-(-1)/i = 1/i
∠z = tan-1(Im(z)/Re(z)) = tan-1(Ib/a)
z = r∠θ
r is modulus 模數 / magnitude 量值/大小
θ is argument 幅角/引數 / phase 相位/相角
r = |z|
argument 幅角
phase 相位/相角
in-phase 同相位
out-of-phase 不同相位
For Acos(ax + b), phase is b. and amplitude is A.
radian 徑度/弧度
phasor 相量
ejx = cosx + isinx = cisx (Euler's formula)
complex conjugate 共軛複數
if z = a + bi,
the complex conjugate of z is
z_bar or z* = a - bi
Re(z*) = Re(z) = a
Im(z*) = -Im(z) = -b
To get z*, simply flip z around x-axis.
|z| = | a + bi | = √(a2 + b2)
|z|2 = |a + bi|2 = a2 + b2 = (a + bi )(a - bi ) = (z)(z*)
Matlab: conj()
>> z = 1 + 2i
z =
1.0000 + 2.0000i
>> z_conj = conj(z)
z_conj =
1.0000 - 2.0000i
conjugate transpose 共軛轉置
相關資料
Euler's formula
complex plane 複數平面
real part 實部
imaginary part 虛部
z = a + bi
Re(z) = a
Im(z) = b
i2 = -1
-i = 1/i proof: -i = -i × i/i = -i2/i =-(-1)/i = 1/i
∠z = tan-1(Im(z)/Re(z)) = tan-1(Ib/a)
z = r∠θ
r is modulus 模數 / magnitude 量值/大小
θ is argument 幅角/引數 / phase 相位/相角
r = |z|
argument 幅角
phase 相位/相角
in-phase 同相位
out-of-phase 不同相位
For Acos(ax + b), phase is b. and amplitude is A.
radian 徑度/弧度
phasor 相量
ejx = cosx + isinx = cisx (Euler's formula)
complex conjugate 共軛複數
if z = a + bi,
the complex conjugate of z is
z_bar or z* = a - bi
Re(z*) = Re(z) = a
Im(z*) = -Im(z) = -b
To get z*, simply flip z around x-axis.
|z| = | a + bi | = √(a2 + b2)
|z|2 = |a + bi|2 = a2 + b2 = (a + bi )(a - bi ) = (z)(z*)
Matlab: conj()
>> z = 1 + 2i
z =
1.0000 + 2.0000i
>> z_conj = conj(z)
z_conj =
1.0000 - 2.0000i
conjugate transpose 共軛轉置
相關資料
Euler's formula
2016/10/07
Matlab: Vector, Matrix, Array and Row/Column Vector
In Matlab,
vector = one-dimensional array
matrix = two-dimensional array
The example below shows the difference between a row vector and a column vector:
>> x = 1:7
x =
1 2 3 4 5 6 7
>> y = x'
y =
1
2
3
4
5
6
7
where
x is a row vector.
y is a column vector.
vector = one-dimensional array
matrix = two-dimensional array
The example below shows the difference between a row vector and a column vector:
>> x = 1:7
x =
1 2 3 4 5 6 7
>> y = x'
y =
1
2
3
4
5
6
7
where
x is a row vector.
y is a column vector.
Matlab: Submatrix/Subvector
A. The example below shows how to:
1. Define a vector with incrementing integers.
2. Define a second vector (subvector) which is formed from partial elements of the first vector.
>> a = 1:10
a =
1 2 3 4 5 6 7 8 9 10
>> b = a(5:7)
b =
5 6 7
B. The example below shows how to get a submatrix from an existing matrix:
c =
1 2 3
4 5 6
7 8 9
>> d = c(2:3,2:3)
d =
5 6
8 9
C. Divide all elements of a vector by an integer:
>> e = a/2
e =
0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000
1. Define a vector with incrementing integers.
2. Define a second vector (subvector) which is formed from partial elements of the first vector.
>> a = 1:10
a =
1 2 3 4 5 6 7 8 9 10
>> b = a(5:7)
b =
5 6 7
B. The example below shows how to get a submatrix from an existing matrix:
c =
1 2 3
4 5 6
7 8 9
>> d = c(2:3,2:3)
d =
5 6
8 9
C. Divide all elements of a vector by an integer:
>> e = a/2
e =
0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000
C語言:檢查字元是否為英文字母 - isalpha()
To use function isalpha(), call
#include <ctype.h>
char ch;
...
if (isalpha(ch)) {
//ch is an alphabet
} else {
//ch is not an alphbet
}
#include <ctype.h>
char ch;
...
if (isalpha(ch)) {
//ch is an alphabet
} else {
//ch is not an alphbet
}
Matlab: 儲存變數於MAT檔案中 Store Variables in MAT-files
PC
To store Matlab variables, select:
File -> Save Workspace As -> *.mat
To retrieve variables stored in a MAT-file, select:
File -> Open -> *.mat
Mac
Click the "Save Workspace" button or press the hotkey:
[command] + [s]
To store Matlab variables, select:
File -> Save Workspace As -> *.mat
To retrieve variables stored in a MAT-file, select:
File -> Open -> *.mat
Mac
Click the "Save Workspace" button or press the hotkey:
[command] + [s]
Matlab: 檢查是否已安裝工具箱 Check if Matlab Image Processing Toolbox already Installed
To check whether the Image Processing Toolbox has already been installed in Matlab, simply type:
help images
help images
Companding 壓擴/壓伸
companding 壓擴/壓伸 = compressing 壓縮 + expanding 擴展
companded quantization = compressor + uniform quantizer 均勻量化 + expander
where
compressor 和 expander 的功能相反
目的:
當dynamic range有限時,透過先壓縮再還原,以減輕失真
在電話等語音通訊中,fricative擦音/磨擦音會因能量較低而無法被有效地量化
透過companding,可使這些語音細節得到較妥善地量化,進而有較好的效果
Companding algorithms of the G.711 ITU-T standard:
μ-law - USA/Japan - 動態範圍(dynamic range)較大,訊號弱時失真(distortion)較大
A-law - Europe - 訊號弱時音質較好
G.711支援A-law以及μ-law兩種編碼方式
Reference
Difference Between A-law and u-Law
G.711 (維基百科)
companded quantization = compressor + uniform quantizer 均勻量化 + expander
where
compressor 和 expander 的功能相反
目的:
當dynamic range有限時,透過先壓縮再還原,以減輕失真
在電話等語音通訊中,fricative擦音/磨擦音會因能量較低而無法被有效地量化
透過companding,可使這些語音細節得到較妥善地量化,進而有較好的效果
Companding algorithms of the G.711 ITU-T standard:
μ-law - USA/Japan - 動態範圍(dynamic range)較大,訊號弱時失真(distortion)較大
A-law - Europe - 訊號弱時音質較好
G.711支援A-law以及μ-law兩種編碼方式
Reference
Difference Between A-law and u-Law
G.711 (維基百科)
2016/09/28
Linear Time-Invariant (LTI) system 線性非時變系統
linear time-invariant system/LTI system 線性非時變系統
linearity 線性
input 和 output 間呈線性的對應關係
time-invariance 非時變性
當 input 在時間上有延遲時,output 也會有相同的延遲
因果線性非時變系統:
h(n) = 0, n < 0
A LTI system may be represented using the following equations with constant coefficients:
Differential Equation 微分方程式 (Continuous-Time)
Difference Equation 差分方程式 (Discrete-Time) e.g. y[n] = Σakx[n-k] + Σbky[n-k]
An LTI system has an impulse response of h(t). The output of the system y(t) can be obtained using the convolution of the input x(t) and the impulse response h(t):
linearity 線性
input 和 output 間呈線性的對應關係
time-invariance 非時變性
當 input 在時間上有延遲時,output 也會有相同的延遲
因果線性非時變系統:
h(n) = 0, n < 0
A LTI system may be represented using the following equations with constant coefficients:
Differential Equation 微分方程式 (Continuous-Time)
Difference Equation 差分方程式 (Discrete-Time) e.g. y[n] = Σakx[n-k] + Σbky[n-k]
An LTI system has an impulse response of h(t). The output of the system y(t) can be obtained using the convolution of the input x(t) and the impulse response h(t):
y(t) = x(t) * h(t)
y[n] = x[n] * h[n]
In the frequency domain, the convolution sign * is replaced by the '·' sign for multiplication.
Y(ω) = X(ω) · H(ω)
Therefore, an LTI system convolutes the input signal with the system's impulse response in the time domain.
Trigonometric Identities 三角恆等式
很多年沒碰數學了
看到可汗學院講解Convolution的影片中
使用到 sin(A-B) = sin(A)cos(B) - cos(A)sin(B)
這些公式早已還給老師們多年
沒想到對於這些睽違已久的「朋友」
居然有一天我還得重新認識一下它們 >_<
查了一下
才知道它們叫做三角恆等式 Trigonometric Identities
以下是一些它們的兄弟
sin(A+B) = sin(A)cos(B) + cos(A)sin(B)
cos(A+B) = cos(A)cos(B) - sin(A)sin(B)
sin(A) + sin(B) = 2sin½(A+B)cos½(A-B)
sin(A) - sin(B) = 2cos½(A+B)sin½(A-B)
sin2(A) + cos2(A) = 1
cos2(A) = ½(1 + cos(2A))
記得在國外讀書時跟台灣有點不同
比較注重的是能否理解
所以這些公式就不太需要背
考試時印象中會提供所需的式子
比較不填鴨
相關名詞
trigonometry 三角學
trigonometric functions 三角函數
conundrum 難題
參考資料
Engineering Mathematics Exposed page 170
看到可汗學院講解Convolution的影片中
使用到 sin(A-B) = sin(A)cos(B) - cos(A)sin(B)
這些公式早已還給老師們多年
沒想到對於這些睽違已久的「朋友」
居然有一天我還得重新認識一下它們 >_<
查了一下
才知道它們叫做三角恆等式 Trigonometric Identities
以下是一些它們的兄弟
sin(A+B) = sin(A)cos(B) + cos(A)sin(B)
cos(A+B) = cos(A)cos(B) - sin(A)sin(B)
sin(A) + sin(B) = 2sin½(A+B)cos½(A-B)
sin(A) - sin(B) = 2cos½(A+B)sin½(A-B)
sin2(A) + cos2(A) = 1
cos2(A) = ½(1 + cos(2A))
記得在國外讀書時跟台灣有點不同
比較注重的是能否理解
所以這些公式就不太需要背
考試時印象中會提供所需的式子
比較不填鴨
相關名詞
trigonometry 三角學
trigonometric functions 三角函數
conundrum 難題
參考資料
Engineering Mathematics Exposed page 170
2016/09/25
Resistance, Reactance, Impedance 電阻、電抗、阻抗
Electrical Impedance:
Z = R + jX or R + jXc
where
Z = impedance in ohms (Ω) 阻抗,單位為歐姆(Ω)
R = resistance in ohms (Ω) 電阻,單位為歐姆(Ω) real part 實部
X = reactance in ohms (Ω) 電抗,單位為歐姆(Ω) imaginary part 虛部
Z = V/I
X = 1/ωC = 1/2πf
ideal resistor with purely real impedance => resistive impedance
ideal inductor/capacitor with purely imaginary impedance => reactive impedance
phasor / phase vector 相量
阻抗可用相量表示
阻抗可以magnitude和phase來表示
magnitude 強度 |Z| = √(R2 + X2)
phase 相位 θ = tan-1(X/R)
Question: What's the reactance of a 2.2µF capacitor with 100Hz frequency?
Answer:
X = 1/ωC = 1/2πf = 1/(2×3.1416×100×2.2×10-6) = 723.4 Ω
Question: Circuit configuration:
Function Generator ---- C ----- Vout ----- R ---- GND
where C = 1µF and R = 2.2 kΩ
Zc = 1/jωC = j/j2ωC = - j(1/ωC) => -90°
A 2.2kΩ resistor and a capacitor are in series. with 100Hz frequency?
Z = R + jX or R + jXc
where
Z = impedance in ohms (Ω) 阻抗,單位為歐姆(Ω)
R = resistance in ohms (Ω) 電阻,單位為歐姆(Ω) real part 實部
X = reactance in ohms (Ω) 電抗,單位為歐姆(Ω) imaginary part 虛部
Z = V/I
X = 1/ωC = 1/2πf
ideal resistor with purely real impedance => resistive impedance
ideal inductor/capacitor with purely imaginary impedance => reactive impedance
phasor / phase vector 相量
阻抗可用相量表示
阻抗可以magnitude和phase來表示
magnitude 強度 |Z| = √(R2 + X2)
phase 相位 θ = tan-1(X/R)
Question: What's the reactance of a 2.2µF capacitor with 100Hz frequency?
Answer:
X = 1/ωC = 1/2πf = 1/(2×3.1416×100×2.2×10-6) = 723.4 Ω
Question: Circuit configuration:
Function Generator ---- C ----- Vout ----- R ---- GND
where C = 1µF and R = 2.2 kΩ
Zc = 1/jωC = j/j2ωC = - j(1/ωC) => -90°
A 2.2kΩ resistor and a capacitor are in series. with 100Hz frequency?
2016/09/17
數學名詞 mathematical terms
mathematics 數學
math 數學(美式英文)
maths 數學(英式英文)
pure mathematics 純數學
applied mathematics 應用數學
arithmetic/arithmetics 算數
algebra 代數
geometry 幾何/幾何學
mathematical analysis 數學分析
calculus 微積分/微積分學
statistics 統計/統計學
natural number 自然數 (positive integers 正整數,如1,2,3... 或 non-negative integers 非負整數 0,1,2,3...)
integer 整數
equality 等於/等式
equal 等於
equal sign 等號
inequality 不等於/不等式
greater than 大於
less than 小於
trigonometry 三角學
trigonometric functions 三角函數
engineering mathematics / mathematical engineering 工程數學
相關資料
香港:An English-Chinese Glossary of Terms Commonly Used in the Teaching of Mathematics in Secondary Schools 中學數學科常用英漢詞彙
math 數學(美式英文)
maths 數學(英式英文)
pure mathematics 純數學
applied mathematics 應用數學
arithmetic/arithmetics 算數
algebra 代數
geometry 幾何/幾何學
mathematical analysis 數學分析
calculus 微積分/微積分學
statistics 統計/統計學
natural number 自然數 (positive integers 正整數,如1,2,3... 或 non-negative integers 非負整數 0,1,2,3...)
integer 整數
equality 等於/等式
equal 等於
equal sign 等號
inequality 不等於/不等式
greater than 大於
less than 小於
trigonometry 三角學
trigonometric functions 三角函數
engineering mathematics / mathematical engineering 工程數學
相關資料
香港:An English-Chinese Glossary of Terms Commonly Used in the Teaching of Mathematics in Secondary Schools 中學數學科常用英漢詞彙
2016/09/13
Differential Amplifier and Operational Amplifier 差動放大器、運算放大器
differential amplifier 差動放大器
差動放大器包括了:
operational amplifier / op-amp / opamp 運算放大器
fully differential amplifier 全差動放大器
instrumentation amplifier 儀器/儀表放大器
isolation amplifier 隔離放大器
negative feedback amplifier 負回授放大器
參考資料:
differential amplifier (Wikipedia)
operational amplifier (Wikipedia)
operational amplifier applications (Wikipedia)
差動放大器包括了:
operational amplifier / op-amp / opamp 運算放大器
fully differential amplifier 全差動放大器
instrumentation amplifier 儀器/儀表放大器
isolation amplifier 隔離放大器
negative feedback amplifier 負回授放大器
參考資料:
differential amplifier (Wikipedia)
operational amplifier (Wikipedia)
operational amplifier applications (Wikipedia)
2016/09/01
Matlab: 轉置矩陣與反矩陣/逆矩陣 Transpose/Inverse of a Matrix
The transpose of a matrix 轉置矩陣
The inverse of a matrix 反矩陣、逆矩陣
Matrix Inversion
The inverse of matrix c can also be written as:
>> e = c^(-1)
e =
-1.5000 0.5000
1.0000 0
>> c*e
ans =
1 0
0 1
The inverse of a matrix 反矩陣、逆矩陣
Matrix Inversion
確認:
>> e = c^(-1)
e =
-1.5000 0.5000
1.0000 0
>> c*e
ans =
1 0
0 1
2016/08/26
Continuous-Time/Discrete-Time/Digital Signals 連續時間訊號/離散時間訊號/數位訊號/類比訊號
signal 訊號/信號
system 系統
analog signal 類比訊號 x(t)
continuous-time signal 連續時間訊號 = Analog Signals
discrete-time signal 離散時間訊號 x[n]
digital signal 數位訊號 - both time and value are discrete. 時間及數值皆為不連續時的訊號
periodic signal 週期訊號 x(t) = x(t + T) where T = duration of period
aperiodic signal / non-periodic signal 非週期訊號
difference equation 差分方程式
constant-coefficient 常係數
liner constant-coefficient difference equation 線性常係數差分方程式
derivative 導數/衍生物
參考資料
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網
MIT Discrete-time signal processing course (Week 1 T1.1 3:00) (edX)
system 系統
analog signal 類比訊號 x(t)
continuous-time signal 連續時間訊號 = Analog Signals
discrete-time signal 離散時間訊號 x[n]
digital signal 數位訊號 - both time and value are discrete. 時間及數值皆為不連續時的訊號
periodic signal 週期訊號 x(t) = x(t + T) where T = duration of period
aperiodic signal / non-periodic signal 非週期訊號
difference equation 差分方程式
constant-coefficient 常係數
liner constant-coefficient difference equation 線性常係數差分方程式
derivative 導數/衍生物
參考資料
國家教育研究院雙語詞彙、學術名詞暨辭書資訊網
MIT Discrete-time signal processing course (Week 1 T1.1 3:00) (edX)
Signals and Systems 訊號與系統
Input-Process-Output (IPO) model
Analog Signal Processing System:
Input: Analog Signal
Process: Analog Signal Processor
Output: Analog Signal
Digital Signal Processing System:
Input: Analog Signal
Process: ADC -> Digital Signal Processor -> DAC
Output: Analog Signal
Transfer Function/System Function - used to represent the black box mathematically.
transfer function 轉換函數/轉移函數/傳遞函數
system function 系統函數
represented as H().
And h is the impulse response of the system.
Example:
system function H(z)
impulse response h[n]
For a system H(z) = Y(z) / X(z) => y[n] = h[n] * x[n]
Since the z-transform of an impulse signal is δ(z) = Σδ[n]z-n = 1,
the impulse response is h[n]:
Y(z) = H(z)X(z) = H(z)δ(z) = H(z) ====z-1====> h[n]
In terms of Fourier transform, the impulse response is h[n] = F-1{H(ejω)}
For an LTI system:
Continuous-Time Signal 連續時間訊號
input - x(t)
output - y(t)
system - H(s) => H(jΩ) (Frequency Domain 頻域)
y(t) = h(t) * x(t)
H(s) = Y(s)/X(s)
Discrete-Time Signal 離散時間訊號
input - x[n]
output - y[n]
system - H(z) => H(ejω) (Frequency Domain 頻域)
y[n] = h[n] * x[n]
H(z) = Y(z)/X(z)
Discrete-time Signal Processing (2nd edition) by A. Oppenheim:
2.1 Basic Sequences and Sequence Operations
Unit sample sequence: 𝛿[n]
Unit step sequence: u[n]
Exponential sequence: x[n] = Aαn
Sinusoidal sequence: x[n] = Acos(ω0n+φ)
impulse function 脈衝函數
delta function δ函數
Transfer function H(ejω)
- mathematical expression for a system
- can be used to derive frequency response including (1) magnitude response (2) phase response
Diagram of (1) and (2) is called the Bode plot 波德圖
impulse response 脈衝響應
frequency response 頻率響應
magnitude response 振幅響應
gain 增益
phase response 相位響應
phase shift 相移/相位偏移
if magnitude and phase output of a system is not changed as desired, there are:
magnitude distortion 振幅失真
phase distortion 相位失真
group delay 群延/群延遲/群組延遲/群體延遲
analytical signal 分析訊號/解析訊號 - complex function without negative frequency.
Analog Signal Processing System:
Input: Analog Signal
Process: Analog Signal Processor
Output: Analog Signal
Digital Signal Processing System:
Input: Analog Signal
Process: ADC -> Digital Signal Processor -> DAC
Output: Analog Signal
Transfer Function/System Function - used to represent the black box mathematically.
transfer function 轉換函數/轉移函數/傳遞函數
system function 系統函數
represented as H().
And h is the impulse response of the system.
Example:
system function H(z)
impulse response h[n]
For a system H(z) = Y(z) / X(z) => y[n] = h[n] * x[n]
Since the z-transform of an impulse signal is δ(z) = Σδ[n]z-n = 1,
the impulse response is h[n]:
Y(z) = H(z)X(z) = H(z)δ(z) = H(z) ====z-1====> h[n]
In terms of Fourier transform, the impulse response is h[n] = F-1{H(ejω)}
For an LTI system:
Continuous-Time Signal 連續時間訊號
input - x(t)
output - y(t)
system - H(s) => H(jΩ) (Frequency Domain 頻域)
y(t) = h(t) * x(t)
H(s) = Y(s)/X(s)
Discrete-Time Signal 離散時間訊號
input - x[n]
output - y[n]
system - H(z) => H(ejω) (Frequency Domain 頻域)
y[n] = h[n] * x[n]
H(z) = Y(z)/X(z)
Discrete-time Signal Processing (2nd edition) by A. Oppenheim:
2.1 Basic Sequences and Sequence Operations
Unit sample sequence: 𝛿[n]
Unit step sequence: u[n]
Exponential sequence: x[n] = Aαn
Sinusoidal sequence: x[n] = Acos(ω0n+φ)
impulse function 脈衝函數
delta function δ函數
Transfer function H(ejω)
- mathematical expression for a system
- can be used to derive frequency response including (1) magnitude response (2) phase response
Diagram of (1) and (2) is called the Bode plot 波德圖
impulse response 脈衝響應
frequency response 頻率響應
magnitude response 振幅響應
gain 增益
phase response 相位響應
phase shift 相移/相位偏移
if magnitude and phase output of a system is not changed as desired, there are:
magnitude distortion 振幅失真
phase distortion 相位失真
group delay 群延/群延遲/群組延遲/群體延遲
analytical signal 分析訊號/解析訊號 - complex function without negative frequency.
2016/08/20
Bluetooth Audio Profiles 與聲音有關的藍牙規範/描述檔
For Audio Streaming (Single-directional)
A2DP (Advanced Audio Distribution Profile) - high quality audio streaming.
AVRCP (Audio/Video Remote Control Profile) - control A/V equipment. Used with A2DP or VDP (Video Distribution Profile).
GAVDP (Generic Audio/Video Distribution Profile) - basis for A2DP and VDP streaming.
For Mobile Phones (Bi-directional)
HSP (Headset Profile) - for headsets to communicate with mobile phones.
HFP (Hands-Free Profile) - for communication between hands-free devices and mobile phones in the car. With extended features to HSP.
More Information:
Differences between HSP & HFP
For Audio Streaming
CTP (Cordless Telephony Profile) - for cordless phones.
參考資料
藍牙規範(維基百科)
如何選購藍芽耳機
A2DP (Advanced Audio Distribution Profile) - high quality audio streaming.
AVRCP (Audio/Video Remote Control Profile) - control A/V equipment. Used with A2DP or VDP (Video Distribution Profile).
GAVDP (Generic Audio/Video Distribution Profile) - basis for A2DP and VDP streaming.
For Mobile Phones (Bi-directional)
HSP (Headset Profile) - for headsets to communicate with mobile phones.
HFP (Hands-Free Profile) - for communication between hands-free devices and mobile phones in the car. With extended features to HSP.
More Information:
Differences between HSP & HFP
For Audio Streaming
CTP (Cordless Telephony Profile) - for cordless phones.
參考資料
藍牙規範(維基百科)
如何選購藍芽耳機
2016/08/15
Matlab: Clear Commands
Clear Command Window: clc
Clear Workspace: clear
Clear a variable: clear variableName
Clear Workspace: clear
Clear a variable: clear variableName
訂閱:
文章 (Atom)