質問編集履歴

1

少しソースコードを変更しました

2020/11/21 13:41

投稿

alastashim
alastashim

スコア16

test CHANGED
File without changes
test CHANGED
@@ -28,21 +28,17 @@
28
28
 
29
29
  T = 1/Fs; % Sampling period
30
30
 
31
- L = num; % Length of signal
31
+ Y = fft(X,num);
32
32
 
33
+ p2 = abs(Y/num);
33
34
 
34
-
35
- Y = fft(X);
36
-
37
- p2 = abs(Y/L);
38
-
39
- p1 = p2(1:L/2+1);
35
+ p1 = p2(1:num/2+1);
40
36
 
41
37
  p1(2:end-1) = 2*p1(2:end-1);
42
38
 
43
39
 
44
40
 
45
- f = Fs*(0:(L/2))/L;
41
+ f = Fs*(0:(num/2))/num;
46
42
 
47
43
 
48
44