27/1/2001
rabbit 2001/1/2 PM 04:52 喂..
Benny 2001/1/2 PM
04:52 hihi
rabbit 2001/1/2 PM 04:52
what are u doing ar?
Benny 2001/1/2 PM
04:53 go to tutoring soon
rabbit 2001/1/2 PM 04:55
ic...
ai..poor me..個icq無端端死o左... restall都唔得
搞左好耐先用得番
rabbit 2001/1/2 PM 10:24 hi
ar...
我想問下..matlab中..fft同fftshift的分別是什麼?
Benny 2001/1/2 PM
10:26 after fft, the spectrum will be:
123456654321
after fftshift
654321123456
normally, we want to execute fftshift after
fft
rabbit 2001/1/2 PM 10:28 咁plot magnitude spectrum是用fft?
Benny 2001/1/2 PM
10:29 abs()
rabbit 2001/1/2 PM 10:29
plot(abs(fft(y)))?
Benny 2001/1/2 PM
10:32 yes, it's better to specify how many pts u
want to plot.
eg to plot the magnitude against 4096 points
plot(linespace(-pi, pi, 4096), abs(...))
rabbit 2001/1/2 PM 10:36 I
don't know how many points I should plot
Benny 2001/1/2 PM
10:36 see the spect, send ur program to me
rabbit 2001/1/2 PM 10:38
Here is the source code of x(t)
x=linspace(-4,4,400)
n=1
while n<=400
if (x(n)<=-2)
y(n)=0
elseif (x(n)<=0)
y(n)=x(n)+2
elseif (x(n)<=1)
y(n)=2
elseif (x(n)<3)
y(n)=2*cos(x(n)*pi/2)+2
elseif
(x(n)>=3)
y(n)=2
end
n=n+1
end
plot(x,y)
Benny 2001/1/2 PM
10:42 it's difficult to understand,
send me the Q
Benny 2001/1/2 PM
10:45 if you run ur code, there must errors
rabbit 2001/1/2 PM 10:47 no
error ar..
Benny 2001/1/2 PM
10:48 have graphs ploted?
rabbit 2001/1/2 PM 10:48
yep..
rabbit 2001/1/2 PM 10:48 I
can't send file to u ar..
Benny 2001/1/2 PM
10:53 sorry,
ok, there is 400 points in your program
use
plot(x, y ) is ur time domain graph
Benny 2001/1/2 PM
10:53 r u using erg line?
rabbit 2001/1/2 PM 10:54
yep...
rabbit 2001/1/2 PM 11:02
so...also use 400 points in the magnitude
spectrum?
Benny 2001/1/2 PM
11:02 yes
rabbit 2001/1/2 PM 11:07 但出來的spectrum太密了..有冇方法放大d?
Benny 2001/1/2 PM
11:08 try to plot more pts
rabbit 2001/1/2 PM 11:24 am
I bothering u?
rabbit 2001/1/2 PM 11:33 am
I bothering u?
Benny 2001/1/2 PM
11:33 no
Benny 2001/1/2 PM
11:42 if you plot the x(t) is right, so the fft of
it is also true
try plot after fftshift
rabbit 2001/1/2 PM 11:55 其實我set
x時做了linspace..plot時應該可以唔駛吧
Benny 2001/1/2 PM
11:58 yes, what's 1c?
rabbit 2001/1/2 PM 11:58 u
told me to try plot fftshift ma..that't it
Benny 2001/1/2 PM
11:59 really??
rabbit 2001/1/2 PM 11:59 is
that wrong??
Benny 2001/1/2 PM
11:59 send me ur code in .m file
Benny 2001/1/2 AM
12:04 sorry, I mean all ur codes, include fft...
rabbit 2001/1/2 AM 12:05 冇呀..我在command window
run script之後才plot
Benny 2001/1/2 AM
12:07 ha ha...
y u do that??
just type in matlab edit mode, don't in
command mode
Benny 2001/1/2 AM
12:07 send to me later, offline a minute