Opened 9 years ago

Last modified 7 years ago

#3277 new enhancement

Discrete Fourier Transform support by OM

Reported by: ceraolo Owned by: somebody
Priority: normal Milestone: Future
Component: *unknown* Version: trunk
Keywords: Cc:

Description

I would like to create a way to make the Discrete Fourier Transform (DFT) of selected signals, and then plot the harmonic spectrum (amplitudes and phases).
This is very useful in electric circuits and system analysis, but useful also for vibration analysis in mechanical systems.

This DFT computation, named FFT, is already available in Dymola, through a post-processing command; it would be nice if something similar can one day become available also in OMEdit.

Indeed maybe DFT can in principle be already done in OM, using a modelica script to be launched from OMC Logger. Indeed I’m trying to do this, although it appears not a very easy task.

Nevertheless, a specific OMEdit command would make computation of harmonic components of signals much easier.

In my opinion, Dymolas’s way is not optimal: harmonic components should be shown in bar charts, not line charts.
For instance I enclose DFT.pdf with pictures from Dymola and another program named PlotXY, that show the difference in readability of results.
The vertical grey bar in PlotXY picture is a moveable cursor to see manually, in numerical form, the computed harmonic values For instance in the shown position it focused on the 5th harmonic and in the box viewable right-low in the window its value of 12.03 is shown.
For me line plots -such as the one created by Dymola- are somewhat misleading: the computed values are indeed individual numbers, not points of a path. Moreover the bars immediately show where computed numbers are located on the horizontal axis.

So my proposal is to plan a future enhancement of OMEdit so that it becomes possible to compute DFT via API, possibly in the form of a bar chart for amplitudes and another for phases of harmonic components.

Attachments (1)

DFT.pdf (272.0 KB) - added by ceraolo 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by ceraolo

comment:1 Changed 7 years ago by ceraolo

If someone wants to make Fourier analysis of OM output, it is now possible with PlotXY, which has been made capable of reading OM matlab files.
If you use an OM version built after October 2017, the mat file contains also Unit of measure information, which is correctly interpreted by PlotXY.

This tool (win, Mac, Linux versions) is available from:

https://drive.google.com/open?id=0B7FNPK1VRgrAMHJwLWtBLVlwMEk

Note: See TracTickets for help on using tickets.