HISE Logo Forum
    • Categories
    • Register
    • Login

    Frequency Shifter

    Scheduled Pinned Locked Moved General Questions
    30 Posts 3 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      clumsybear
      last edited by clumsybear

      the node was opened while exporting the snippet, did it work on your side?

      If I was wrong, this is the snippet with the expanded node

      HiseSnippet 2615.3oc6cssaaibFdnkGaKEmrs6FTjdmvhdQVfDBwSRVnWXm3CaMZbVUKmr6cFzTijILEIWRJ63snnW2GgsW0KK5CPA5c6s8knnOB6aP6bfTbH0IZAaJYaJff34D42++7+8O+bFxYZ44Xf78c7.BkO4ZWDPXSX6qsCNe2y0MsAGtGP34vC7Pe+.jsw0sO2ra.x6TEvau1U22G0AHHT5qI0Tn7p.5ued62paoaafhyB.9nioA5cl8MChys0N+dSKqCz6fNwrOWsU24PCG6ccrbFfQUIXMfqtwE58PuWmTsUf.g01uiYfiW6.8.jOPX025zAiMmqrY0+il9lmYgHIj.swWHV1G3X0gfXRtfcO2zpSqHo2G.Dfsh0EkX5hmCOxri4v7i0I+BZAUiaAu9PXkoAOId3UKyvCvgtUYnCCBmNCrzCRhLR2QXAlN1IP1g1AHaeyfq46tVnv8WBaYFXb93w6JiAu3Np6Z7F14+T39c6hLBhA6pvC9t69dZAgQ0cUfsM7LcCv2eBP1LLY0C9N4D.hkMP3eBqtucOSajngGBis87ceOJ3JGuKd4WNjM6Gxlk9xu521cfsAQ8W00C4p6gNwokk90uzWuuqE5X7U3UUOyxw3h1l+.5qp7GqTtxepRUtFQA7aI03kFmqaair7GsZDVscfmi0KsGz+Lj2qpdot0f3q2HD6RSVexSrGS24wNCBLs6cjdfm4mvb62Onear+DCztgnCmmvJ.RSooqQRSrtZir6PS7+v+BKThjVHrPonBADgAYGfyOT2R67B+a7ekx44P0MoRNcvRwFGnafk1qaoGbNgJfc6Efs0PdhFiy6azEPFfklX4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Zu8Tntst009HQRQK06vuIJ4CGtmdfNw4e3AXAWUED1CcooAh4ZoLbOj+EANtINdTdFqPrVC+T8zyJHpV7WQSW8a0uDU8qQ3m2m49dBGTPU+o+y+HqGTPtY9fB5aLBv29S7zs8cc7Sbgai5adhiMQFiyDSnHtYYSfDW965n6M1h94sO.KjisMs0CF3Q6QdSemA1AINxZJk4yIlavAVzpEGXQy5Tho1TOkXRbR6TNBisMImvG6icGYg4E.1R3rGpq9.qfnbSZWejisi64N1DWvwc5GiB7L60CkHr4wJPuIHP23h3bd9NGivg7xa.+a14cXCOcuiXOSz7nKjxttXZ8Wu.xfaUBYr5CiCZpROJOnoxkCIo73dzW2vy4TC1YKEcSQmlCVtsoGYbkgGQRWUBbY7TYWCzG6Q7TCins.iw2F44nMJyQaTmi1nMGso9bzlFyQa1ZpsgLXzaFD3zmQEwYzZeZTIBBwy1QIv+GfPOo5L
      
      1 Reply Last reply Reply Quote 0
      • C
        clumsybear
        last edited by

        The only thing left would be to separate the sidebands. But I’m not sure how to substract signals from each other in scriptnode

        1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart
          last edited by

          Multiply with -1 and add.

          1 Reply Last reply Reply Quote 0
          • C
            clumsybear
            last edited by

            I get the math.mul with -1, but add like in math.add with value 0? Or do you mean to just sum the two signal chains after flipping the phase? @Christoph-Hart

            1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart
              last edited by

              You don't need the add node, just use a split container and flip the phase of one signal:

              HiseSnippet 1402.3oc6X87abSDEdb1LMIaaQkRPhiqBbHUpDEuMPQhC61jMaTDYSVhS+wsnI1SxNJ1yXrGmzsENAG3eA3.bE3.24D8O.hTkx+.vQtEtvAtTdiG6X6MaRVVozTUgur67Mu23u22al2LiaGHroggh.jwDaz0mhLtF1pKW1YgNDFGsbCjwafaQBkzfJZn465SBCoNHCiRKo.LlXTT7yQ0lm3R31zLHD5ABlMcElGSlg1t9mvbcaRbnav7xY8b0W1VvWP3Jh.9TBOKxm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wv5W1InQwLvouc0.1y8WtAQRTZQxQixYpgQC5dv8H0GIdBbCZ3tRgegytOotyqheHYOZ7UXiOQzaG2daQfWkknvFhpKgXdFWh84C5kX8G3KwtlsDnvFADdnuHjZlej6oup46qAUFwKZtFpfUpvqIDd4ra75ofUyC1lvKLXP6BiTK0gcSa960VjSfieaQgnwYsPaHXI8L8ncjaHMdYfYdGyfqlG1nzPckohWpMm8++E4O0KxWZvn64bCzIR4nEScwvEgxRtvRxXNdSXM31jHWYJZw0TsDbgeGAmYmeB15T3BU6rCsXMl9EP2SJI16lgLY80otTRXt0YuW8UfC3RBh2dX3zByAWKNq706f0zshpPPkWO9.LkdM5CvbQrBEpU9JPl9kwGp3kw6viXGH1zV+oYTK8FOFAhad7W9cBbKU6Jln8zmBAimclYQdPA7MssUyNdePe5uOUGBetyP3ybCgOevP3yGND9b2gvmO5L8Qs248hjBO87e.n8hwmeyvPetg3kBn+E.xMaFB
              
              1 Reply Last reply Reply Quote 0
              • C
                clumsybear
                last edited by

                ok, got you! So if I want create a duplicate signal with -90° phase shift I multiply by -0.5, right?

                1 Reply Last reply Reply Quote 0
                • C
                  clumsybear
                  last edited by

                  well, I'll just keep it as it is for now and call it a ring modulator ;)

                  1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart
                    last edited by

                    ok, got you! So if I want create a duplicate signal with -90° phase shift I multiply by -0.5, right?

                    I am not a DSP expert, but the only trivial phase change that can be achieved by simple multiplication is 180° because it's just a flip of the signal. Multiplying with -0.5 will just result in a 180° phase shift plus a gain adjustment of -6dB.

                    Any other phase change can't be applied on a signal because there is no frequency dependant phase value, so you'll need some kind of all pass filter which does that for you.

                    To be honest, I've still haven't heard one frequency shifter that does not use FFT processing which doesn't sound like the last breaths of a dying robot (even the one in the STK toolkit sounds rather, well "experimental"), but if your "ring modulator" sounds good, then don't touch it :)

                    1 Reply Last reply Reply Quote 0
                    • C
                      clumsybear
                      last edited by

                      @Christoph-Hart said in Frequency Shifter:

                      Multiplying with -0.5 will just result in a 180° phase shift plus a gain adjustment of -6dB.

                      makes sense, I already figured out that even if I manage to flip the phase by 90° it will only change the phase of one frequency. Like you said, I'd need a Allpass filter network of some kind. That's why I rendered out a Hilbert transfer function as an IR in Matlab. It's an IR of an Allpass filter network that results in a phase flip of 90° over a 500-15000hz range with minimal error.

                      @Christoph-Hart said in Frequency Shifter:

                      To be honest, I've still haven't heard one frequency shifter that does not use FFT processing which doesn't sound like the last breaths of a dying robot (even the one in the STK toolkit sounds rather, well "experimental"), but if your "ring modulator" sounds good, then don't touch it 🙂

                      It only sounds ok if I put the whole node graph in a 2 frame block container and oversample the frame block container . if not there are too many artefacts.

                      So the issue right now is that Im not able to run an IR within the frame block container. If they are in separate frame blocks, the result is terrible.

                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        How long is that impulse response?

                        You might get away with brute-force convolution (just a normal FIR filter) if the tap size is below 64.

                        1 Reply Last reply Reply Quote 0
                        • C
                          clumsybear
                          last edited by

                          It's 1024 samples long and generated at 44100 SR. I'm not sure about the tap size, is it the same as the length in samples?

                          1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart
                            last edited by

                            Yes, well that may be too long and if you oversample this to run per sample, it will definitely burn your CPU (since you can't do FFT based convolution with one sample and have to resort to brute-force time-domain convolution).

                            I don't know too much about FIR filter design, but if you take a look at the 1024 sample IR, is there any substantial (non-zero) value after ~64 samples? Because if not you can truncate it to 64 samples (which is the break-even point where the FFT based convolution will yield better performance) and check how it sounds.

                            1 Reply Last reply Reply Quote 0
                            • C
                              clumsybear
                              last edited by

                              I had a read on that topic, and it seems to work with exactly 64 samples as well. I'll try to render out a smaller version or truncate it.

                              Can you elaborate on the brute force convolution technique wit FIR filter in HISE? I'm not entirely sure what you're referring to.

                              1 Reply Last reply Reply Quote 1
                              • Christoph HartC
                                Christoph Hart
                                last edited by

                                The current convolution module is doing the convolution on the frequency domain, but for smaller impulse responses (as I said, up to 64 samples), directly convoluting each sample is more efficient (and in our case, also possible on per-sample level). The pseudo code algorithm for this looks like something like this (it's not the actual formula, but the complexity is similar:

                                for(int i = 0; i < blockSize; i++)
                                {
                                    for(int j = 0; j < irSize; j++)
                                    {
                                        output[i] += output[i - j] * ir[j] ;
                                    }
                                }
                                

                                As you can see, it has to iterate over the IR size for each sample so for bigger impulse responses the CPU power goes up exponentially.

                                I think I will add a filter.fir module that you can use instead of the convolution module, which will do this and work in a frame container.

                                1 Reply Last reply Reply Quote 1
                                • Christoph HartC
                                  Christoph Hart
                                  last edited by

                                  Actually I just need to wrap this JUCE class, which does it already :)

                                  1 Reply Last reply Reply Quote 2
                                  • C
                                    clumsybear
                                    last edited by clumsybear

                                    Damn, that sounds promising man! :) Thanks for clarifying

                                    1 Reply Last reply Reply Quote 1
                                    • C
                                      clumsybear
                                      last edited by

                                      @Christoph-Hart Did you happen to find time to implement the FIR module?

                                      1 Reply Last reply Reply Quote 2
                                      • Christoph HartC
                                        Christoph Hart
                                        last edited by

                                        No not, yet, but maybe I find the time today.

                                        1 Reply Last reply Reply Quote 1
                                        • Christoph HartC
                                          Christoph Hart
                                          last edited by

                                          There you go:

                                          Link Preview Image
                                          - added filter.fir node · christophhart/HISE@53cadb9

                                          The open source framework for sample based instruments - - added filter.fir node · christophhart/HISE@53cadb9

                                          favicon

                                          GitHub (github.com)

                                          It's basically a convolution reverb that can be applied in polyphonic contexts and frame processing. Since it's brute force convolution in the time domain it caps the impulse response at 128 samples, otherwise the CPU would explode if you try to feed it with a big impulse.

                                          1 Reply Last reply Reply Quote 3
                                          • C
                                            clumsybear
                                            last edited by

                                            @Christoph-Hart said in Frequency Shifter:

                                            It's basically a convolution reverb that can be applied in polyphonic contexts and frame processing. Since it's brute force convolution in the time domain it caps the impulse response at 128 samples, otherwise the CPU would explode if you try to feed it with a big impulse.

                                            Thank you, I'll give it a try :)

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post

                                            53

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.0k

                                            Posts