从功率谱到时域
我需要从功率谱上得到频率范围 然后再把这个范围的功率谱转换到时域 怎么办? 大家帮帮我啊 缺少相位信息,可以加随机相位。 加随即相位不是每次得到的结果都不一样吗? x=[-1.4-10.8
-10.1
-8.8
-9.5
-12
-14.2
-12.8
-11
-8.5
-8.5
-13.1
-17.6
-19.4
-16.2
-14.4
-10.8
-8.2
-4.2
-6.6
-13.1
-19
-19.6
-6.6
3
14.1
-4.9
-12.8
-14.4
-20.3
-26
-32.5
-30.6
-17.2
-19.7
-16.3
-16.4
-6.7
2.5
15
23.6
25.2
33.6
46.3
49.2
41.9
35.9
27.1
23.5
33.9
41.2
53
63.9
73.2
65.2
59.9
40
40
6.3
-51.5
-78.7
-60.3
-48.4
-25
-5.9
13.4
30.8
49.9
71
99.5
121.9
152.9
144.9
115.5
93.5
89.2
92.6
83.9
90.1
99.3
120.9
32.8
-147.5
-206.6
-198.9
-203.4
-181.6
-172.5
-175.2
-175.3
-180.5
-163
-134.7
-108.7
-78.2
-42.9
-1.7
36
78.5
116.4
159.8
196
241.2
272.9
303.6
320
341.7
282.1
232.4
-119.8
-237.3
-164
-186.5
-109.5
-75.3
-17.3
11.3
53.3
89.5
118.6
175.7
57.6
-263.1
-154.7
-172.9
-101.2
-57.9
23.7
-67
-198
-164.1
-168.5
-148.1
-123.1
-100.1
-75.1
-52.3
-27.1
-4.4
18.8
-9.5
-43.3
-83.8
-95.1
-71.6
-59.9
-33.4
-10.8
18.5
42
67.3
-9.7
-37.2
-4
1.1
34.4
56.5
88.3
113
136.3
21.9
24.1
68.3
68.9
131.8
135.3
204
-93.1
-130.8
-69.2
-54.6
7.2
67.5
-106.7
-148.8
-107.1
-116.2
-76.2
-55.9
-21.5
-12.6
-67.4
-32.4
-33.7
-10.9
1.7
29.9
48.8
60.8
22.2
-3.2
-24.5
7.7
21.1
56.8
82.6
120.6
147.8
173.7
42.1
2.9
25.9
29.3
-5.5
-14.7
14.3
20.6
49.9
64.5
95.7
112.8
144.7
162.9
194.5
185.6
198.4
176.9
125
-120.7
-54.2
-38.4
-31.1
-111.8
-166.1
-246.4
-202.5
-183.5
-131.7
-96
-32.5
15.4
81.6
131.9
181.8
-5.8
-16.9
28.5
44.7
98.3
142.4
185.3
245.6
168.5
-138
-99.9
-108.9
-90.7
-46.9
-125
-211.1
-161.7
-169.2
-130.6
-111.1
-77.3
-51
-54.4
-120
-120.9
-115.8
-114.5
-71.7
-54.6
6.4
-80.4
-163.4
-85.9
-96.1
-39.6
-14.7
31.9
64.8
87.6
47.2
19.8
-2.7
29.2
44.5
78.5
103.3
135.2
160.6
186.1
128.1
64
20.4
31.4
37.3
49.6
23.5
-8.4
-16.8
-11.3
-22.9
-24.8
-15.7
-6.9
14.7
37.9
57.9
25.5
-4.1
-42.8
-13.3
9.5
23
-12.9
-5
8
21
38
51
15.7
-3.2
-11.1
0.5
7.6
3.5
-9.5
-3.6
-1.6
3.8
8.5
-5.6
-30.4
-42.1
-24.4
-23.6
-17.7
-12.9
-1.8
20.3
-10.8
-9.1
-3.4
-10.6
-11.1
-9.9
-0.2
7.3
23.5
35.5
70.5
77.9
18.4
-26.3
-12.4
-4.2
15.9
4.8
-21.9
-46.7
-42.8
-21.6
-4.3
15.9
32
41.9
12.3
-16
-20.4
-8.2
-20.6
-13.7
-5.5
5.3
13.4
26.6
23.2
7.9
-0.8
20
43.5
49.2
19.1
9.2
-2.2
-2.1
5.2
9.3
25.5
36.8
52.5
54.1
42.5
39.8
55.9
75.6
36.5
41.1
9.8
-20.4
-24.9
-40.5
-41.3
-47.1
-43.3
-45.8
-5.7
17.8
-20.8
-49.2
-53
-36.2
-40.5
-30.8
-31.6
-26.5
-26.5
-26.9
-34.5
-30.9
-21.7
-7.8
8.7
28.1
31
35.8
34.1
35.8
28.7
30.5
11.2
21.4
13.6
38.4
-86.1
-134.9
-134.2
-135.4
-119.3
-104.2
-82.9
-65.1
-44.4
-25.8
-6
-9.1
-18.2
-14.7
8.5
16.3
5
26.4
58.2
86.7
120
169.5
111.1
-110
-36.6
-44.5
-23.6
-96
-65.6
-59.7
-67
-55.2
-2.7
37.8
107.2
166.9
94.7
40.8
66.7
13.2
-9.5
-52
-82.7
-115.2
-115
-80.3
-36.9
2.9
54.5
117.8
161
-27
3.4
-5.6
2
14.6
53.7
79.8
-20.5
-59
-16.9
-17.5
-2.8
7.4
38.2
56.7
75.3
80.1
59.2
30.4
2.3
6.4
-40.6
-45.1
-7.9
16.8
56.7
9.3
-5.5
4.4
-12.3
-28.2
-43.7
-35.2
-25.5
-11.1
20.5
51.9
85.4
114.4
73.3
23.7
-36.8
-27.1
-21.7
-87.3
-97.3
-58.9
-33.6
7.7
25.9
50.8
36.1
8.1
-5.6
-20.9
-31.7
-23.8
-37.6
-55
-72.2
-80.3
-52.3
-34
-1.1
6.5
-3.7
-0.5
-16.8
-41
-8
7.9
37.4
61.5
66.5
25.4
-5.7
-47.4
-35.6
-24.3
-4.8
12.6
37.9
24.1
-22.7
-42.8
-67.9
-66.1
-59
-51.3
-40.8
-30.9
-26.6
-54.1
-62.8
-90.8
-110.7
-88.1
-77
-58.2
-47.3
-33.3
-19.9
2
21.1
43.2
61.3
76.7
93.3
106.6
113
118.7
124.7
133.4
159.4
179.7
203.7
123.6
44.2
-14
-66.6
-55.5
-69.3
-98.4
-124.6
-117.9
-105
-92
-74.3
-80.9
-85
-86
-86.3
-87.3
-86.8
-88.5
-53.7
5.2
21.5
24.5
58
31.4
23.6
48.5
58.9
52.5
35.5
19.7
19.9
49.2
34.3
28.8
43.2
23.9
8.8
7.7
-14.8
-7.7
-1.9
7.5
4.4
-14.5
-31.6
-24.1
-2.8
18.2
42.6
43.9
51.2
46.6
47.9
19.3
22.2
27.4
39.3
50.4
57.7
58.8
82.2
79.7
94.9
34.5
4.5
-12.3
-34.7
-42.6
-41.6
-27.5
-27
7.4
42.8
-23.1
-38.7
-8.3
13.9
44.5
2.7
-69.7
-79.6
-25.1
-13.5
7.9
-11.5
-25.1
-33.3
-26.9
-30.1
-20
-6.7
-3.8
10.5
29.6
34.4
95.7
89.8
17.9
-36.2
-99.4
-80.7
-74.4
-53.9
-33
-12.8
3.1
14.8
50.8
-2.2
-48.9
-35.8
-69.1
-51.6
-37.1
8.8
63.2
84.1
127.6
138.8
119.3
75.1
22.5
-8.8
-22.7
7.4
18.1
54.4
39.9
4.5
-8.2
-18.5
-2
0.6
-11.7
-21
-30.3
-51.2
-72.7
-57.9
-26.6
-17.8
4
9.8
13.7
22.1
43.7
9.1
-54.8
-55.5
-24.3
-8.1
25
41
18.2
-2.7
-24.3
-1.5
24.7
48.2
78.3
62.2
33.1
-1.4
-19.5
-24.7
-21.2
-11
5
24.1
-3.4
-21.6
-47.1
-36.3
-19.5
-1.8
17
-8
0.5
23
37.4
60.1
51.6
43.2
34.4
50.5
65.3
68.3
17.2
-17
-52.7
-66.4
-38.7
-22.2
-3.3
11.9
-12.8
-35.1
-51.4
-33.5
-21.8
-1.2
14.2
7
-6.3
-12
-32.2
-34.6
-9.1
7.3
30.9
47.2
60.3
57.6
33
-7.3
-77.7
-60.8
-43.8
-20.9
3.1
35
29.3
12.1
33.8
31.7
25.4
20.6
19.8
17.4
2.1
-14.4
-34.3
-33.9
-14.5
-2.8
17
-9.6
-25.5
-27.9
-38.8
-24.2
-21.5
-18.2
-17.4
-3.8
-2.7
-18.5
-12.3
8.7
34.3
69.5
91
85.3
76
51.3
18.6
1.5
-19
-15.1
-7.3
2.1
12.9
21.5
2.4
-12.4
-32.9
-51.9
-70.8
-57.9
-46.2
-30.7
-14.5
-0.9
-18
-31.8
-46.5
-39.1
-34.5
-31.6
-43.5
-49.1
-47.5
-42
-36.1
-27.7
-25.8
-13.9
-6.8
50.7
72.2
87.8
78.2
76.5
43.9
8
1.3
-12.6
-1.5
3
10.4
10.4
19.3
20.5
7.4
-5.6
-7.2
7
10.6
14.7
-0.9
-15.9
-18.7
-0.7
15.5
10.5
-11.5
-30.2
-30.9
-9.5
-5.8
0.4
2
5
5.7
9.7
13.4
17.7
21.8
26.1
30.2
34.6
38.6
47.4
39.3
23.8
11.5
-7.9
-12.4
5.4
2.7
-25
-56.6
-63
-59.1
-41.3
-6.8
27.2
27.7
-2.1
-6
-11
-22.1
-41.6
-51.9
-22.2
3
7.9
13.9
17.1
25.3
32.3
39.1
16.4
-13.6
-32.3
-29.1
-28.7
-30.4
-33.9
-24.5
-7.6
12.5
37.6
40.2
24.5
15.6
-4
-15.3
-28.9
-31.6
-11.1
9.4
33.5
57.6
42.4
14.3
-0.7
-13.5
-27
-34.1
-35.7
-39.6
-40.2
-48.8
-48
-40.6
-40.7
-35.1
-18.7
-5.7
4.4
-1.9
-7.2
-16.9
-11.5
12.6];
t=1:1:1000;
figure(1)
subplot(511)
plot(t,x)
fs=1000;%设定采样频率
N=1000;
n=0:N-1;
y=-i*13*x
figure(1)
subplot(512)
plot(t,y)
Y=fft(y,N)
Px=Y.*abs(Y)/fs; %功率谱
f=(0:N-1)*fs/N%进行对应的频率转换
figure(1)
subplot(513)
plot(f,Px)
fmin=0;%最小截止频率
fmax=150;%最大截止频率
y=ifft(Y,N);
%计算频率间隔(Hz/s)
df=fs/N;
%计算指定频带对应频率数组的下标
ni=round(fmin/df+1);
na=round(fmax/df+1);
%计算圆频率间隔(rad/s)
dw=2*pi*df;
%建立正的离散圆频率向量
w1=0:dw:2*pi*0.5*fs;
%建立负的离散圆频率向量
w2=-2*pi*(0.5*fs-df):dw:-dw;
%将正负圆频率向量组合成一个向量
w=;
figure(1)
subplot(514)
plot(f,w)
it=1;%积分次数
w=w.^it;
%进行积分的频域变换
for i=1:N
a(i) =y(i)./w(i);
end
a1=imag(a);
a2=real(a);
y=a1-a2*i;
a=zeros(1,N);
%消除指定正频带外的频率成分
a(ni:na)=y(ni:na);
%消除指定负频带外的频率成分
a(N-na+1:N-ni+1)=y(N-na+1:N-ni+1);
y=real(y(1:N))
figure(1)
subplot(515)
plot(t,y);
事关重大啊
接着说以上程序的开头的x矩阵是我的数据,我想得到这个数据的傅立也谱,再找到需要的频率范围,然后再对这个频率范围进行你变换得到时域,怎么做啊? 大家帮帮我啊 程序中可能有错。楼主先设了:
y=-i*13*x
经傅里叶变换
Y=fft(y,N)
后又做
y=ifft(Y,N);
这句可能是错的,把频域转成时域了,但后面(对y)的积分又是在频域做的,怎么用了时域的变量? 能帮我具体改改吗? 现在不明白你要处理数据的目的,好象程序和你“从功率谱到时域”不相干。希望把问题说清楚。 好像就是滤波?
把不要的频率范围全部置零,用小波是否要好些呢? 我是想用实测地震波的纪录转换到另外的时程:
知道了天津波的时程纪录,然后得到这个纪录的傅立叶谱,在得到需要的频率范围,在把这个频率范围进行傅立叶逆变换得到另外一个时程,这各时程才是我需要的数据解释这样,大家帮帮我!可能是上面的程序有问题 那是我自己瞎弄的 目前还是不对,大家帮我看看阿
事关重大阿
x=[-1.4-10.8
-10.1
-8.8
-9.5
-12
-14.2
-12.8
-11
-8.5
-8.5
-13.1
-17.6
-19.4
-16.2
-14.4
-10.8
-8.2
-4.2
-6.6
-13.1
-19
-19.6
-6.6
3
14.1
-4.9
-12.8
-14.4
-20.3
-26
-32.5
-30.6
-17.2
-19.7
-16.3
-16.4
-6.7
2.5
15
23.6
25.2
33.6
46.3
49.2
41.9
35.9
27.1
23.5
33.9
41.2
53
63.9
73.2
65.2
59.9
40
40
6.3
-51.5
-78.7
-60.3
-48.4
-25
-5.9
13.4
30.8
49.9
71
99.5
121.9
152.9
144.9
115.5
93.5
89.2
92.6
83.9
90.1
99.3
120.9
32.8
-147.5
-206.6
-198.9
-203.4
-181.6
-172.5
-175.2
-175.3
-180.5
-163
-134.7
-108.7
-78.2
-42.9
-1.7
36
78.5
116.4
159.8
196
241.2
272.9
303.6
320
341.7
282.1
232.4
-119.8
-237.3
-164
-186.5
-109.5
-75.3
-17.3
11.3
53.3
89.5
118.6
175.7
57.6
-263.1
-154.7
-172.9
-101.2
-57.9
23.7
-67
-198
-164.1
-168.5
-148.1
-123.1
-100.1
-75.1
-52.3
-27.1
-4.4
18.8
-9.5
-43.3
-83.8
-95.1
-71.6
-59.9
-33.4
-10.8
18.5
42
67.3
-9.7
-37.2
-4
1.1
34.4
56.5
88.3
113
136.3
21.9
24.1
68.3
68.9
131.8
135.3
204
-93.1
-130.8
-69.2
-54.6
7.2
67.5
-106.7
-148.8
-107.1
-116.2
-76.2
-55.9
-21.5
-12.6
-67.4
-32.4
-33.7
-10.9
1.7
29.9
48.8
60.8
22.2
-3.2
-24.5
7.7
21.1
56.8
82.6
120.6
147.8
173.7
42.1
2.9
25.9
29.3
-5.5
-14.7
14.3
20.6
49.9
64.5
95.7
112.8
144.7
162.9
194.5
185.6
198.4
176.9
125
-120.7
-54.2
-38.4
-31.1
-111.8
-166.1
-246.4
-202.5
-183.5
-131.7
-96
-32.5
15.4
81.6
131.9
181.8
-5.8
-16.9
28.5
44.7
98.3
142.4
185.3
245.6
168.5
-138
-99.9
-108.9
-90.7
-46.9
-125
-211.1
-161.7
-169.2
-130.6
-111.1
-77.3
-51
-54.4
-120
-120.9
-115.8
-114.5
-71.7
-54.6
6.4
-80.4
-163.4
-85.9
-96.1
-39.6
-14.7
31.9
64.8
87.6
47.2
19.8
-2.7
29.2
44.5
78.5
103.3
135.2
160.6
186.1
128.1
64
20.4
31.4
37.3
49.6
23.5
-8.4
-16.8
-11.3
-22.9
-24.8
-15.7
-6.9
14.7
37.9
57.9
25.5
-4.1
-42.8
-13.3
9.5
23
-12.9
-5
8
21
38
51
15.7
-3.2
-11.1
0.5
7.6
3.5
-9.5
-3.6
-1.6
3.8
8.5
-5.6
-30.4
-42.1
-24.4
-23.6
-17.7
-12.9
-1.8
20.3
-10.8
-9.1
-3.4
-10.6
-11.1
-9.9
-0.2
7.3
23.5
35.5
70.5
77.9
18.4
-26.3
-12.4
-4.2
15.9
4.8
-21.9
-46.7
-42.8
-21.6
-4.3
15.9
32
41.9
12.3
-16
-20.4
-8.2
-20.6
-13.7
-5.5
5.3
13.4
26.6
23.2
7.9
-0.8
20
43.5
49.2
19.1
9.2
-2.2
-2.1
5.2
9.3
25.5
36.8
52.5
54.1
42.5
39.8
55.9
75.6
36.5
41.1
9.8
-20.4
-24.9
-40.5
-41.3
-47.1
-43.3
-45.8
-5.7
17.8
-20.8
-49.2
-53
-36.2
-40.5
-30.8
-31.6
-26.5
-26.5
-26.9
-34.5
-30.9
-21.7
-7.8
8.7
28.1
31
35.8
34.1
35.8
28.7
30.5
11.2
21.4
13.6
38.4
-86.1
-134.9
-134.2
-135.4
-119.3
-104.2
-82.9
-65.1
-44.4
-25.8
-6
-9.1
-18.2
-14.7
8.5
16.3
5
26.4
58.2
86.7
120
169.5
111.1
-110
-36.6
-44.5
-23.6
-96
-65.6
-59.7
-67
-55.2
-2.7
37.8
107.2
166.9
94.7
40.8
66.7
13.2
-9.5
-52
-82.7
-115.2
-115
-80.3
-36.9
2.9
54.5
117.8
161
-27
3.4
-5.6
2
14.6
53.7
79.8
-20.5
-59
-16.9
-17.5
-2.8
7.4
38.2
56.7
75.3
80.1
59.2
30.4
2.3
6.4
-40.6
-45.1
-7.9
16.8
56.7
9.3
-5.5
4.4
-12.3
-28.2
-43.7
-35.2
-25.5
-11.1
20.5
51.9
85.4
114.4
73.3
23.7
-36.8
-27.1
-21.7
-87.3
-97.3
-58.9
-33.6
7.7
25.9
50.8
36.1
8.1
-5.6
-20.9
-31.7
-23.8
-37.6
-55
-72.2
-80.3
-52.3
-34
-1.1
6.5
-3.7
-0.5
-16.8
-41
-8
7.9
37.4
61.5
66.5
25.4
-5.7
-47.4
-35.6
-24.3
-4.8
12.6
37.9
24.1
-22.7
-42.8
-67.9
-66.1
-59
-51.3
-40.8
-30.9
-26.6
-54.1
-62.8
-90.8
-110.7
-88.1
-77
-58.2
-47.3
-33.3
-19.9
2
21.1
43.2
61.3
76.7
93.3
106.6
113
118.7
124.7
133.4
159.4
179.7
203.7
123.6
44.2
-14
-66.6
-55.5
-69.3
-98.4
-124.6
-117.9
-105
-92
-74.3
-80.9
-85
-86
-86.3
-87.3
-86.8
-88.5
-53.7
5.2
21.5
24.5
58
31.4
23.6
48.5
58.9
52.5
35.5
19.7
19.9
49.2
34.3
28.8
43.2
23.9
8.8
7.7
-14.8
-7.7
-1.9
7.5
4.4
-14.5
-31.6
-24.1
-2.8
18.2
42.6
43.9
51.2
46.6
47.9
19.3
22.2
27.4
39.3
50.4
57.7
58.8
82.2
79.7
94.9
34.5
4.5
-12.3
-34.7
-42.6
-41.6
-27.5
-27
7.4
42.8
-23.1
-38.7
-8.3
13.9
44.5
2.7
-69.7
-79.6
-25.1
-13.5
7.9
-11.5
-25.1
-33.3
-26.9
-30.1
-20
-6.7
-3.8
10.5
29.6
34.4
95.7
89.8
17.9
-36.2
-99.4
-80.7
-74.4
-53.9
-33
-12.8
3.1
14.8
50.8
-2.2
-48.9
-35.8
-69.1
-51.6
-37.1
8.8
63.2
84.1
127.6
138.8
119.3
75.1
22.5
-8.8
-22.7
7.4
18.1
54.4
39.9
4.5
-8.2
-18.5
-2
0.6
-11.7
-21
-30.3
-51.2
-72.7
-57.9
-26.6
-17.8
4
9.8
13.7
22.1
43.7
9.1
-54.8
-55.5
-24.3
-8.1
25
41
18.2
-2.7
-24.3
-1.5
24.7
48.2
78.3
62.2
33.1
-1.4
-19.5
-24.7
-21.2
-11
5
24.1
-3.4
-21.6
-47.1
-36.3
-19.5
-1.8
17
-8
0.5
23
37.4
60.1
51.6
43.2
34.4
50.5
65.3
68.3
17.2
-17
-52.7
-66.4
-38.7
-22.2
-3.3
11.9
-12.8
-35.1
-51.4
-33.5
-21.8
-1.2
14.2
7
-6.3
-12
-32.2
-34.6
-9.1
7.3
30.9
47.2
60.3
57.6
33
-7.3
-77.7
-60.8
-43.8
-20.9
3.1
35
29.3
12.1
33.8
31.7
25.4
20.6
19.8
17.4
2.1
-14.4
-34.3
-33.9
-14.5
-2.8
17
-9.6
-25.5
-27.9
-38.8
-24.2
-21.5
-18.2
-17.4
-3.8
-2.7
-18.5
-12.3
8.7
34.3
69.5
91
85.3
76
51.3
18.6
1.5
-19
-15.1
-7.3
2.1
12.9
21.5
2.4
-12.4
-32.9
-51.9
-70.8
-57.9
-46.2
-30.7
-14.5
-0.9
-18
-31.8
-46.5
-39.1
-34.5
-31.6
-43.5
-49.1
-47.5
-42
-36.1
-27.7
-25.8
-13.9
-6.8
50.7
72.2
87.8
78.2
76.5
43.9
8
1.3
-12.6
-1.5
3
10.4
10.4
19.3
20.5
7.4
-5.6
-7.2
7
10.6
14.7
-0.9
-15.9
-18.7
-0.7
15.5
10.5
-11.5
-30.2
-30.9
-9.5
-5.8
0.4
2
5
5.7
9.7
13.4
17.7
21.8
26.1
30.2
34.6
38.6
47.4
39.3
23.8
11.5
-7.9
-12.4
5.4
2.7
-25
-56.6
-63
-59.1
-41.3
-6.8
27.2
27.7
-2.1
-6
-11
-22.1
-41.6
-51.9
-22.2
3
7.9
13.9
17.1
25.3
32.3
39.1
16.4
-13.6
-32.3
-29.1
-28.7
-30.4
-33.9
-24.5
-7.6
12.5
37.6
40.2
24.5
15.6
-4
-15.3
-28.9
-31.6
-11.1
9.4
33.5
57.6
42.4
14.3
-0.7
-13.5
-27
-34.1
-35.7
-39.6
-40.2
-48.8
-48
-40.6
-40.7
-35.1
-18.7
-5.7
4.4
-1.9
-7.2
-16.9
-11.5
12.6];
t=1:1:1000;
figure(1)
subplot(311)
plot(t,x)
fs=300;%设定采样频率
N=1000;
n=0:N-1;
y=sin(-i*0.0013*x)
figure(1)
subplot(312)
plot(t,y)%
fmin=0;%最小截止频率
fmax=1;%最大截止频率
ny=length(y);
nfft=2^nextpow2(ny);
%计算频率间隔(Hz/s)
df=fs/nfft;
%计算指定频带对应频率数组的下标
ni=round(fmin/df+1);
na=round(fmax/df+1);
%计算圆频率间隔(rad/s)
dw=2*pi*df;
%建立正的离散圆频率向量
w1=0:dw:2*pi*0.5*fs;
%建立负的离散圆频率向量
w2=-2*pi*(0.5*fs-df):dw:-dw;
%将正负圆频率向量组合成一个向量
w=;
Y=fft(y,nfft)
%进行积分的频域变换
a=zeros(1,nfft);
for i=2:nfft-1
a(i) =Y(i)./w(i);
end
a1=imag(a);
a2=real(a);
Y1=a1-a2*i;
a=zeros(1,nfft);
%消除指定正频带外的频率成分
a(ni:na)=Y1(ni:na);
%消除指定负频带外的频率成分
a(nfft-na+1:nfft-ni+1)=Y1(nfft-na+1:nfft-ni+1);
Y2=ifft(a,nfft);
%取逆变换的实部n个元素并乘以单位变换系数为积分结果
Y3=real(Y2(1:N))
figure(1)
subplot(313)
plot(t,Y3);
大家帮我看看这个程序怎样处理才能得到我要的结果啊 大家帮帮我啊:'( 本帖最后由 wdhd 于 2016-9-9 13:49 编辑
原帖由 zjhtyg 于 2008-4-11 20:25 发表
我是想用实测地震波的纪录转换到另外的时程:
知道了天津波的时程纪录,然后得到这个纪录的傅立叶谱,在得到需要的频率范围,在把这个频率范围进行傅立叶逆变换得到另外一个时程
从上的说明,实际上是要对信号滤波,可以用数字滤波器完成。
但从提供的程序看,在频域还进行积分,这为什么?
笫1个程序中
y=-i*13*x
笫2个程序中
y=sin(-i*0.0013*x)
同一组x,2个程序得到的y相差甚远,不知楼主怎么考虑的。 还建议楼主把数据存储在一个数据文件中,否则在帖子上占了大量篇幅,阅读起来很不方便。 两个程序中的y没关系,只是想说明我要做的东西
页:
[1]
2