編集するデータを取り​込むことはできたので​すが,そのあとのコマ​ンド入力の方法や操作​が分からなくて困って​います.

3 visualizaciones (últimos 30 días)
富田
富田 el 17 de Sept. de 2025
Respondida: Kojiro Saito el 17 de Sept. de 2025
>> T = 0.002; % サンプル周期
L = 1001; % 信号のポイント数(時間じゃないので注意!)
t = (0:L-1)*T; % 時間ベクトル
Y = fft(sum);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
Fs = 1/T;
F = Fs*(0:(L/2))/L;
plot(F,P1);
次を使用中のエラー: sum
入力引数が不足しています。

Respuestas (1)

Kojiro Saito
Kojiro Saito el 17 de Sept. de 2025
sum は足し算をおこなう関数なのでsum(t) などのように「足し算したい配列」を入れる必要があります。
ただ、fft で信号をフーリエ変換したいのかなと思いますので、fft のドキュメントにある例のように、信号データを入力に入れる必要があります。sum で何かの信号を足し算をしたかったのかなと思いますが、下記のサンプルでは50Hz の信号S にフーリエ変換をする例をお示しします。
T = 0.002; % サンプル周期
L = 1001; % 信号のポイント数(時間じゃないので注意!)
t = (0:L-1)*T; % 時間ベクトル
S = sin(2*pi*50*t); % 50Hzの信号
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
Warning: Integer operands are required for colon operator when used as index.
P1(2:end-1) = 2*P1(2:end-1);
Fs = 1/T;
F = Fs*(0:(L/2))/L;
plot(F,P1);

Categorías

Más información sobre フーリエ解析とフィルター処理 en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!