Write two vectors as convolutionExtremely large weighted averageHow can I use fast FFT-based convolution to implement a LPF if the fast convolution requires a LPF?Fast Convolution Output too big?Deconvolution of data convolved by a Gaussian responseSpeeding up Matlab DFTs with NAG functionsHow to downsample Fourier complex values?Recovering time function from its single-sided spectrum + its HermitianIFFT Matlab symmetric vs Java math commonsMatlab: fourier coefficients of sign() function are oscillatingWhen and how to do zero-padding for a discrete convolution?

How can Internet speed be 10 times slower without a router than when using the same connection with a router?

Why would a military not separate its forces into different branches?

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

Make me a minimum magic sum

Is space itself expanding or is it just momentum from the big bang carrying things apart?

Sparring against two opponents test

Counting the Number of Real Roots of A Polynomial

Meaning of the (idiomatic?) expression "seghe mentali"

Should I simplify my writing in a foreign country?

What Kind of Wooden Beam is this

Why is "breaking the mould" positively connoted?

What is the closest airport to the center of the city it serves?

How to calculate rate of axial precession?

Krull dimension of the ring of global sections

Speed up this NIntegrate

Is any special diet an effective treatment of autism?

Looking for sci-fi book based on Hinduism/Buddhism

Gerrymandering Puzzle - Rig the Election

How can a hefty sand storm happen in a thin atmosphere like Martian?

Why does sound not move through a wall?

In linear regression why does regularisation penalise the parameter values as well?

Page count conversion from single to double-space for submissions

Why would one crossvalidate the random state number?

How to remap repeating commands i.e. <number><command>?



Write two vectors as convolution


Extremely large weighted averageHow can I use fast FFT-based convolution to implement a LPF if the fast convolution requires a LPF?Fast Convolution Output too big?Deconvolution of data convolved by a Gaussian responseSpeeding up Matlab DFTs with NAG functionsHow to downsample Fourier complex values?Recovering time function from its single-sided spectrum + its HermitianIFFT Matlab symmetric vs Java math commonsMatlab: fourier coefficients of sign() function are oscillatingWhen and how to do zero-padding for a discrete convolution?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















How to write two column vectors as an analytic convolution so that the discrete FFT may be used. MATLAB syntax is used.



Consider:




  1. a set of vectors which, when sorted into a step function appears as any of the following:



    [1,1,1,1,0,0,0,0], or [1,1,1,1,1,0,0,0], or [1,1,1,1,1,1,0,0]



    (...the location at which the function "steps up" varies over members of this set)



  2. The other is random vec=[1,0,1,0,1,1,1,0], and obviously both contain only 0s and 1s.


Is it possible to write these vectors as an analytic convolution? I would like the 1st, 2nd, 3rd, 4th... entries of the convolution to have values of:



sum(vec.*[1,0,0,0,0,0,0,0])
sum(vec.*[1,1,0,0,0,0,0,0])
sum(vec.*[1,1,1,0,0,0,0,0])
sum(vec.*[1,1,1,1,0,0,0,0])
...
sum(vec.*[1,1,1,1,1,1,1,1])


For speed, I am trying to avoid use of a for-loop. I cannot vectorize because this requires terabytes of RAM. (I work with vectors that are not of length 8, but rather length nearly a million).



The convolution theorem gives the function R from the convolution of functions L and 1/w from the Fourier transform F and its inverse F-1 as,



<code>[R(w) = int fracL(w')w - w' + i0^ + dw' = F^ - 1left( Fleft( L(w) right) cdot Fleft( textstyle1 over w right) right)]</code>



Clearly, the function 1/(w-w') in the convolution is from 1/w under F; it's as if you just set w'=0. But if I use analogous reasoning in my [1,1,1,1,0,0,0,0], I get either [1,1,1,1,1,1,1,1], the identity under .* in MATLAB or [0,0,0,0,0,0,0,0](a very boring result).



What is the mistake in reasoning I've made?










share|improve this question
























  • I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

    – Cris Luengo
    Mar 23 at 4:06


















0















How to write two column vectors as an analytic convolution so that the discrete FFT may be used. MATLAB syntax is used.



Consider:




  1. a set of vectors which, when sorted into a step function appears as any of the following:



    [1,1,1,1,0,0,0,0], or [1,1,1,1,1,0,0,0], or [1,1,1,1,1,1,0,0]



    (...the location at which the function "steps up" varies over members of this set)



  2. The other is random vec=[1,0,1,0,1,1,1,0], and obviously both contain only 0s and 1s.


Is it possible to write these vectors as an analytic convolution? I would like the 1st, 2nd, 3rd, 4th... entries of the convolution to have values of:



sum(vec.*[1,0,0,0,0,0,0,0])
sum(vec.*[1,1,0,0,0,0,0,0])
sum(vec.*[1,1,1,0,0,0,0,0])
sum(vec.*[1,1,1,1,0,0,0,0])
...
sum(vec.*[1,1,1,1,1,1,1,1])


For speed, I am trying to avoid use of a for-loop. I cannot vectorize because this requires terabytes of RAM. (I work with vectors that are not of length 8, but rather length nearly a million).



The convolution theorem gives the function R from the convolution of functions L and 1/w from the Fourier transform F and its inverse F-1 as,



<code>[R(w) = int fracL(w')w - w' + i0^ + dw' = F^ - 1left( Fleft( L(w) right) cdot Fleft( textstyle1 over w right) right)]</code>



Clearly, the function 1/(w-w') in the convolution is from 1/w under F; it's as if you just set w'=0. But if I use analogous reasoning in my [1,1,1,1,0,0,0,0], I get either [1,1,1,1,1,1,1,1], the identity under .* in MATLAB or [0,0,0,0,0,0,0,0](a very boring result).



What is the mistake in reasoning I've made?










share|improve this question
























  • I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

    – Cris Luengo
    Mar 23 at 4:06














0












0








0








How to write two column vectors as an analytic convolution so that the discrete FFT may be used. MATLAB syntax is used.



Consider:




  1. a set of vectors which, when sorted into a step function appears as any of the following:



    [1,1,1,1,0,0,0,0], or [1,1,1,1,1,0,0,0], or [1,1,1,1,1,1,0,0]



    (...the location at which the function "steps up" varies over members of this set)



  2. The other is random vec=[1,0,1,0,1,1,1,0], and obviously both contain only 0s and 1s.


Is it possible to write these vectors as an analytic convolution? I would like the 1st, 2nd, 3rd, 4th... entries of the convolution to have values of:



sum(vec.*[1,0,0,0,0,0,0,0])
sum(vec.*[1,1,0,0,0,0,0,0])
sum(vec.*[1,1,1,0,0,0,0,0])
sum(vec.*[1,1,1,1,0,0,0,0])
...
sum(vec.*[1,1,1,1,1,1,1,1])


For speed, I am trying to avoid use of a for-loop. I cannot vectorize because this requires terabytes of RAM. (I work with vectors that are not of length 8, but rather length nearly a million).



The convolution theorem gives the function R from the convolution of functions L and 1/w from the Fourier transform F and its inverse F-1 as,



<code>[R(w) = int fracL(w')w - w' + i0^ + dw' = F^ - 1left( Fleft( L(w) right) cdot Fleft( textstyle1 over w right) right)]</code>



Clearly, the function 1/(w-w') in the convolution is from 1/w under F; it's as if you just set w'=0. But if I use analogous reasoning in my [1,1,1,1,0,0,0,0], I get either [1,1,1,1,1,1,1,1], the identity under .* in MATLAB or [0,0,0,0,0,0,0,0](a very boring result).



What is the mistake in reasoning I've made?










share|improve this question
















How to write two column vectors as an analytic convolution so that the discrete FFT may be used. MATLAB syntax is used.



Consider:




  1. a set of vectors which, when sorted into a step function appears as any of the following:



    [1,1,1,1,0,0,0,0], or [1,1,1,1,1,0,0,0], or [1,1,1,1,1,1,0,0]



    (...the location at which the function "steps up" varies over members of this set)



  2. The other is random vec=[1,0,1,0,1,1,1,0], and obviously both contain only 0s and 1s.


Is it possible to write these vectors as an analytic convolution? I would like the 1st, 2nd, 3rd, 4th... entries of the convolution to have values of:



sum(vec.*[1,0,0,0,0,0,0,0])
sum(vec.*[1,1,0,0,0,0,0,0])
sum(vec.*[1,1,1,0,0,0,0,0])
sum(vec.*[1,1,1,1,0,0,0,0])
...
sum(vec.*[1,1,1,1,1,1,1,1])


For speed, I am trying to avoid use of a for-loop. I cannot vectorize because this requires terabytes of RAM. (I work with vectors that are not of length 8, but rather length nearly a million).



The convolution theorem gives the function R from the convolution of functions L and 1/w from the Fourier transform F and its inverse F-1 as,



<code>[R(w) = int fracL(w')w - w' + i0^ + dw' = F^ - 1left( Fleft( L(w) right) cdot Fleft( textstyle1 over w right) right)]</code>



Clearly, the function 1/(w-w') in the convolution is from 1/w under F; it's as if you just set w'=0. But if I use analogous reasoning in my [1,1,1,1,0,0,0,0], I get either [1,1,1,1,1,1,1,1], the identity under .* in MATLAB or [0,0,0,0,0,0,0,0](a very boring result).



What is the mistake in reasoning I've made?







fft convolution






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 4:02









Cris Luengo

24k62254




24k62254










asked Mar 23 at 2:19









ignoramusignoramus

81




81












  • I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

    – Cris Luengo
    Mar 23 at 4:06


















  • I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

    – Cris Luengo
    Mar 23 at 4:06

















I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

– Cris Luengo
Mar 23 at 4:06






I think maybe you need to add some code to this, because I can't figure out what it is that you are trying to do. Yes, you can write any vector as a convolution of other vectors. What you describe with sum(vector.*[...]) looks to be just cumsum(vec), I'm not sure I understand what you're looking for. I also don't understand how the vectors you show relate to 1/w.

– Cris Luengo
Mar 23 at 4:06













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309995%2fwrite-two-vectors-as-convolution%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309995%2fwrite-two-vectors-as-convolution%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript