+rphzrun - new jersey institute of technologyjoelsd/fundamentals/homework/bme... · 2019. 11....
TRANSCRIPT
BME 310 Biomedical Computing -J.Schesser
54
Sampling and Aliasing
Lecture #6
Chapter 4
BME 310 Biomedical Computing -J.Schesser
55
Homework
• Exercises:– 4.1 – 4.5
• Problems:– 4.1, 4.2, 4.3,
– 4.4, Use Matlab to plot the signal in part a.
– 4.5, 4.8, 4.11, 4.19
BME 310 Biomedical Computing -J.Schesser
56
Homework
• Problems:– 4.1
1
( ) 10cos(880 )
[ ] ( ) 10cos(880 )
440 ; 0.0001; 10,000 /
10000Number of samples per cycle 22.7
440
[ ] ( ) 10cos(0.0880 )
cos( 2 ) cos( )
0.0880 2 2.088
2.088 / 2.088
s s
s s
s
s
x t t
x n x nT nT
f Hz T f s s
x n x nT n
n
T
1
/ 0.0001 20880
20880 / 2 10440
10000Number of samples per cycle .957
10440
f Hz
BME 310 Biomedical Computing -J.Schesser
57
Homework
• Problems:– 4.2
ffHzf
nnnx
ssf
ffHzf
nnnx
ssf
ffHzf
nnnx
ssf
fnnx
tttx
s
s
s
s
s
s
s
2;ˆ D;OVERSAMPLE ;5.5
)2/733.0cos(7)2/15/11cos(7][
/15
2 ;ˆLED; UNDERSAMP;5.5
)2/2.2cos(7)2/5/11cos(7][
/5
2;ˆ LED; UNDERSAMP;5.5
)2/1.1cos(7)2/10/11cos(7][
/10
)2//11cos(7][
)2/11cos(7)11sin(7)(
><--
<>--
<>--
-
-
BME 310 Biomedical Computing -J.Schesser
58
Homework
• Problems:– 4.3
Hzfl
flf
Hzfl
Hzfl
flf
flf
ssf
nnx
s
s
s
s
5100;1
/2).32(
and
6900;1
900;0
/2;)2.3(
)2.3(2
are aliases
/6000
)3/3.0cos(2.2][
´-
´´
-
BME 310 Biomedical Computing -J.Schesser
59
Homework• Problem 4-4
4
4 4
4
) ( ) [10 cos(2 (2,000) )]cos(2 (10 ) )
10cos(2 (10 ) ) cos(2 (2,000) )cos(2 (10 ) )
1 110cos(2 (10 ) ) cos(2 (10,000 2,000) ) cos(2 (10,000 2,000) )
2 21 1
10cos(2 (10,000) ) cos(2 (8,000) ) cos(2 (122 2
a x t t t
t t t
t t t
t t
-
2 (10,000) 2 (10,000) 2 (8,000) 2 (8,000) 2 (12,000) 2 (12,000)
2 (10,000) 2 (10,000) 2 (8,000) 2 (8,000) 2 (12,000) 2
,000) )
1 110( ) ( ) ( )
2 2 2 2 25 5 0.25 0.25 0.25 0.25
j t j t j t j t j t j t
j t j t j t j t j t j
t
e e e e e e
e e e e e e
- - -
- - -
(12,000)
2 (8,000) 2 (8,000) 2 (10,000) 2 (10,000) 2 (12,000) 2 (12,000)
1 2 3 1 2 3
4 4
5 5
6 6
0.25 0.25 5 5 0.25 0.25
) 2000 ; 6; 1/ 2000 .0005 5 sec
0
0.25
5
t
j t j t j t j t j t j t
o
e e e e e e
b LCD Hz N T
a a a a a a a
a a
a a
a a
- - -
- - -
-
-
-
max
0.25
) 12,000 ; 24,000sb f Hz f Hz
10,000
12,0008,000-10,000
-12,000-8,000
5
0.250.25
5
0.250.25
BME 310 Biomedical Computing -J.Schesser
60
Homework• Problem 4-4
4
4 4
4
) ( ) [10 cos(2 (2,000) )]cos(2 (10 ) )
10cos(2 (10 ) ) cos(2 (2,000) )cos(2 (10 ) )
1 110cos(2 (10 ) ) cos(2 (10,000 2,000) ) cos(2 (10,000 2,000) )
2 21 1
10cos(2 (10,000) ) cos(2 (8,000) ) cos(2 (122 2
a x t t t
t t t
t t t
t t
-
2 (10,000) 2 (10,000) 2 (8,000) 2 (8,000) 2 (12,000) 2 (12,000)
2 (10,000) 2 (10,000) 2 (8,000) 2 (8,000) 2 (12,000) 2
,000) )
1 110( ) ( ) ( )
2 2 2 2 25 5 0.25 0.25 0.25 0.25
j t j t j t j t j t j t
j t j t j t j t j t j
t
e e e e e e
e e e e e e
- - -
- - -
(12,000)
2 (8,000) 2 (8,000) 2 (10,000) 2 (10,000) 2 (12,000) 2 (12,000)
1 2 3 1 2 3
4 4
5 5
6 6
0.25 0.25 5 5 0.25 0.25
) 2000 ; 6; 1/ 2000 .0005 5 sec
0
0.25
5
t
j t j t j t j t j t j t
o
e e e e e e
b LCD Hz N T
a a a a a a a
a a
a a
a a
- - -
- - -
-
-
-
max
0.25
) 12,000 ; 24,000sb f Hz f Hz
10,000
12,0008,000-10,000
-12,000-8,000
5
0.250.25
5
0.250.25
BME 310 Biomedical Computing -J.Schesser
61
Homework• Problem 4-4
HzfHzfb
aa
aa
aa
aaaaaaa
TNHzLCDb
eeeeee
eeeeee
eeeeee
ttt
ttt
ttt
tttxa
s
o
tjtjtjtjtjtj
tjtjtjtjtjtj
tjtjtjtjtjtj
000,24;000,12)
25.0
5
25.0
0
sec50005.2000/1;6;2000)
25.025.05525.025.0
25.025.025.025.055
)2
(2
1)
2(
2
1)
2(10
))000,12(2cos(2
1))000,8(2cos(
2
1))000,10(2cos(10
))000,2000,10(2cos(2
1))000,2000,10(2cos(
2
1))10(2cos(10
))10(2cos())000,2(2cos())10(2cos(10
))10(2cos()])000,2(2cos(10[)()
max
66
55
44
321321
)000,12(2)000,12(2)000,10(2)000,10(2)000,8(2)000,8(2
)000,12(2)000,12(2)000,8(2)000,8(2)000,10(2)000,10(2
)000,12(2)000,12(2)000,8(2)000,8(2)000,10(2)000,10(2
4
44
4
-
-
-
-
---
---
---
---
10,000
12,0008,000-10,000
-12,000-8,000
5
0.250.25
5
0.250.25
BME 310 Biomedical Computing -J.Schesser
62
Matlab Code used in problem 4.4
%problem 4.4fc=10^4;fi=2*10^3;Period=1/fi;Points=100;Timestart=0;Timedelta=Period/Points;Timeend=4*Period;time = (Timestart:Timedelta:Timeend);max=length(time);for i=1:max
y(i)=(10+cos(2*pi*fi*time(i)))*cos(2*pi*fc*time(i));endenv1=cos(2*pi*fi*time)+10;env2=-10-cos(2*pi*fi*time);plot(time,y,'r',time,env1,'b',time,env2,'b');title('Amplitude Modulation Plot');xlabel('Seconds');axis([ Timestart Timeend -1.5*10 +1.5*10]);
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x 10-3
-15
-10
-5
0
5
10
15Amplitude Modulation Plot
Seconds
BME 310 Biomedical Computing -J.Schesser
63
Matlab Code used in problem 4.4%problem 4.4
clear allfc=10^4;fi=2*10^3;ratio=fc/fi-1;fs=100*fc;ts=1/fs;cycles=5;DC=5;mod=.5*DC;time=(0:ts:cycles/fi);maxtime=length(time);for i=1:maxtime
x(i)=(DC+mod*cos(2*pi*fi*time(i)))*cos(2*pi*fc*time(i));endenv1=DC+mod*cos(2*pi*fi*time);env2=-DC-mod*cos(2*pi*fi*time);subplot(2,1,1)plot(time,x,'b',time,env1,'r',time,env2,'r');title('Time Domain');xlabel('Time (Seconds)')freqs=(0:fs/maxtime:fs-fs/maxtime);subplot(2,1,2)y=fft(x)/maxtime;stem(freqs,abs(y));title('Frequency Domain');xlabel('Frequency (Hz)')axis([(fc-ratio*fi) (fc+ratio*fi) 0 1.1*max(abs(y))])
0 0.5 1 1.5 2 2.5
x 10-3
-10
-5
0
5
10Time Domain
Time (Seconds)
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
x 104
0
1
2
Frequency Domain
Frequency (Hz)
BME 310 Biomedical Computing -J.Schesser
64
Homework
• Problems:– 4.5
)7/400cos(10)(
200;2.ˆ
/2;.2
.22
are aliases
/2000
)7/2.0cos(10][ )
-
´
-
ttx
Hzf
ff
ff
ssf
nnxb
s
s
s
edUndersampl
)7/1800cos(10)(
900;2.2ˆ;1
/2).22(
and
dOversample
)7/200cos(10)(
100;2.ˆ;0
/2;)2.2(
)2.2(2
are aliases
/1000
)7/2.0cos(10][
-
´-
-
´´
-
ttx
Hzfl
flf
ttx
Hzfl
flf
flf
ssf
nnx
s
s
s
s
BME 310 Biomedical Computing -J.Schesser
65
Homework
• Problems:– 4.8
50 50 700 700
50 700 50 700 700 50 700 50
750 650 650 750
750 650 650
) ( ) cos(50 )sin(700 )
( ) ( )( )2 2
( )4
( )4
4 4
j t j t j t j t
j t j t j t j t j t j t j t j t
j t j t j t j t
j t j t j
a x t t t
e e e ex t
j
e e e e e e e e
j
e e e e
j
e e e
j j
- -
- - - -
- -
-
-
- -
- -
-
750
3 3
2 2 2 2750 650 650 750
2 2 2 2750 650 650 750
2 2 2 2750 750 650 650
4 4
4 4 4 4
4 4 4 4
4 4 4 4
t j t
j j j j
j t j t j t j t
j j j j
j t j t j t j t
j j j j
j t j t j t j t
e
j j
e e e ee e e e
e e e ee e e e
e e e ee e e e
-
- - - -
- -
- -
- -
- -
- -
-
BME 310 Biomedical Computing -J.Schesser
66
Homework
• Problems:– 4.8
(750 ) (750 ) (650 ) (650 )2 2 2 2
750 752 2
OR
( ) cos(50 )sin(700 ) cos(50 ) cos(700 )2
1[cos(750 ) cos(650 )]
2 2 21
[cos(750 ) cos(650 )]2 2 2
1[ ]
2 2 2
1[
4
j t j t j t j t
j jj t j
x t t t t t
t t
t t
e e e e
e e e e
- - - - - -
- -
-
- -
- -
0 650 6502 2 ]
750) Maximum frequency is 375
2Nyquist rate is mimium sampling rate = 2 375 750 /
j jt j t j te e e e
b
s s
- -
´
BME 310 Biomedical Computing -J.Schesser
67
Homework
• Problems: 4.11 Short Method( ) [3 sin( )]cos(13 / 2)
( ) [3 cos( / 2)]cos(13 / 2)
3cos(13 / 2) cos( / 2) cos(13 / 2)
1 13cos(13 / 2) cos(12 ) cos(14 )
2 21 1
cos(12 ) 3cos(13 / 2) cos(14 )2 2
Highest frequenc
x t t t
x t t t
t t t
t t t
t t t
-
-
y 14 , 28s >
6 6.5 7
3/2e jππ/2
1/4 e -jp 1/4 e j0
BME 310 Biomedical Computing -J.Schesser
68
Homework• Problems: 4.11 Long Method
28,14frequency Highest
)12cos(2
1)14cos(
2
1)2/13cos(3
)2/12sin(2
1)2/14sin(
2
1)2/13cos(3
]4
)()([]
2[3
]4
[]2
[3
]4
[]2
[3
]2
][2
[]2
[3
]2
][2
3[
)2/13cos()]sin(3[)(
)2/12()2/12()2/14()2/14()2/13()2/13(
)2/14()2/12()2/12()2/14()2/13()2/13(
)2/13()2/13()2/13()2/13()2/13()2/13(
)2/13()2/13()2/13()2/13(
)2/13()2/13(0
>
-
-
---
--
--
-
-
---
---
-----
---
--
s
tjtjtjtjtjtj
tjtjtjtjtjtj
tjtjtjtjtjtjtjtjtjtj
tjtjtjtjtjtj
tjtjtjtjj
ttt
ttt
j
eeeeee
j
eeeeee
j
eeeeeeeeee
ee
j
eeee
ee
j
eee
tttx
6 6.5 7
3/2e jπ/2
1/4 e -jπ 1/4 e j0
BME 310 Biomedical Computing -J.Schesser
69
Homework
• Problems:– 4.19
0
0.5
1
1.5
2
2.5
3
3.5
0 1 2 3 4 5
0 2.42711 2.90022 2.98163 2.66034 1.9798
17
23696.
)9816.2(2
9002.26603.2cos)
][2
]1[]1[(cos
]1[]1[cos][2
])1[]1[(]1[]1[cos][2cos][2
]1[]1[cos][2
cos2][
]1[
][
]1[
][]1[
][]1[
][][][
]}[{}{][
: trick thisuseor plot thefrom guesscan You
11
)1(
1)1(
jj
jjj
j
j
-
---
-
-
-
ÂÂ
--
-
----
nx
nxnx
nxnxnx
nynyjnxnxnjynx
nznznz
eenz
nz
nz
nz
enzeeAeeAenz
enzeeAeeeAeeAenz
njynxeAenz
nzeeAeenx
o
o
oo
o
ojj
jjnjjnjj
jjnjjjnjjnjj
njj
njj
oo
oooo
oooooo
o
o
)5/17/2cos(3][
3809.
4271.2cos/]0[
5/62831.361242.
93247.19492.1tan
)tan(361242.93247.19492.14271.2
9002.2
)tan()sin()cos(cos
)sin()sin()cos()cos(
cos
)cos(
]0[
]1[
)cos(]1[;cos]0[
1
j
j
j
jj
jjjj
jj
-
---
-
-
--
-
nnx
xA
x
x
AxAx
oooo
o
o