11-30-2024 10:15 AM
Andrey solution is what fits me the best, as your solution @altenbach obtains a convolution in the time domain. My convolution is in the Fourier domain (a multiplication in time), but for the requests of my project, the convolution must be carried out in the fourier domain.
My input vectors, a and b, are already defined in the Fourier domain
11-30-2024 10:28 AM - edited 11-30-2024 10:49 AM
@gaiab03 wrote:
Andrey solution is what fits me the best, as your solution @altenbach obtains a convolution in the time domain. My convolution is in the Fourier domain (a multiplication in time), but for the requests of my project, the convolution must be carried out in the fourier domain.
My input vectors, a and b, are already defined in the Fourier domain
They are mathematically equivalent, A convolution in one domain is a multiplication in the other and there is no need to pigeonhole things into time and frequency.
If you want to do simple code, here's what you can do:
Arguably, a single FOR loop is simpler than a stack of loops and the array operation can more easily take advantages of SIMD instructions for more performance. There is also no need for herding cats indices.
If it is just a few lines of Matlab code, it should not require a lot of graphical code!
11-30-2024 11:02 AM
On a side note, some might be stumped on how the outer FOR loop in the original solution determines the number of iterations. There is actually an indexing tunnel hidden underneath the shift register! Talk about code obfuscation!
(I suspect that was intentional here, but of course does not belong in clear code 😄 )
Of course all solutions assume that all input arrays have the same size.
11-30-2024 11:15 AM
Also note that since all your data is in the imaginary part and integer values, the entire thing could be done in I32 (but be careful with overflow for much larger inputs (values and array sizes!)).
Same result!
12-01-2024 01:29 AM
Thank you so much!
12-02-2024 05:24 AM
Hi! @Altenbach I have a problem, when I add in position 0 and 100, a real number equal to 5000 in my a vector:
I should be obtaing something like this and mirrored around 100 and 200:
But this is what I get:
I'm using your code
12-02-2024 10:09 AM
@gaiab03 wrote:
Hi! @Altenbach I have a problem, when I add in position 0 and 100, a real number equal to 5000 in my a vector:
I should be obtaing something like this and mirrored around 100 and 200:
I never said that my code is what you need, just that it produces the same as your Matlab code (and Andrey's code). When describing a scenario, make sure to attach a VI with typical data so we can reproduce it.
Just throwing words like "this" and "that" and a few images does not tell us what we should be looking at.