- 追加された行はこの色です。
- 削除された行はこの色です。
[[小林研究室ホームページ]]
realfft.m
#ref(realfft.m,left,realfft.m)
使用例usage:
+ foo.datという名前で時間応答波形を保存しておく.一列目に時間,二列目にデータが記録されているとする.Suppose time response is stored in a file named foo.dat where 1st and 2nd columns are time sequence and time response to be analyzed, respectively.
#ref(result.dat,left,サンプルデータsample data)
+ 波形を読み込む To read sample data
>> load result.dat
+ 周波数解析を実行する To execute FFT analysis
>> h = 0.0005.
>> [dc,amp,phase,f,n] = realfft(result(:,2),h);
where
h:サンプリング周期 sampling period[sec],
dc:直流成分(平均値) DC component,
amp:振幅 amplitude,
phase:位相 phase [deg],
f:周波数 frequency [Hz],
n:データ点数 number of data points.
+ 結果を表示する To plot the result
>> w = 2*pi*f;
>> Pzz_g = frd(amp, w);
>> bodemag(Pzz_g, 'b');
- 補足:周波数軸をrad/sec→Hz,縦軸をdB→絶対値に変更する場合 To change frequency unit,
>> ctrlpref
使用例2 example of execution:
#ref(fft_sample.m);