Important: Please read the Qt Code of Conduct -


  • Hey, guys. I want to creat a chart with an Square signal. I already wrote the function from the fourier transformation. But i only get a sinus function.

    double SimRechteckSensor::getValue()
        static double x;
        double fx;
        return fx;

  • I haven't done this kind of math in around 10 years but isn't the square wave the limit of the fourier (i.e. you need infinite armonics to obtain it) making it impossible in practice to build that way?

  • yes thats true. But if you want to get a chart with a fourier transformation, i found out, that you have to type in:

    Because you are trying to divide a integer by integer. That gives you a integer back. In this case its zero. When you typ for example 3.0 insted of 3 you divide integer by double and then you get a double back. Now simply find a good solution for x to get a nice chart. Should be working. But, how VRonin said, its not a real square Chart (watch youtube).

    In my program i programmed some if else cases that gives me for y value 1 or 0 back.

Log in to reply