Dear All, I wonder why windowing functions such as Hann, Hamming, etc., provided by window(), are only symmetric. When used for spectral analysis by subsequent use of fft(), the periodic weighting is better than the symmetric one. The symmetric window is mainly used in the design of FIR filters, which I guess is a less frequent application than spectral analysis. While it is true that an easy workaround to get a periodic window of length n is, for instance w = window("hn", n+1)(1:$-1); a syntax such as this w = window("hn", n, "per"); would be easier. Setting "sym" as the default option, no backward compatibility issues would possibly arise. Regards, Federico Miyara _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Dear all, Just in case somebody finds this useful, I'm attaching a proposal of a modified version of the function window() which includes three new window functions: Blackman, Blackman-Harris and one out of many different flat-top windows. It also allows a new argument, opt, which can be either "per" for periodic option or "sym" or any other value (or no value) for triggering the default symmetric option. If there were interest, several other windows could be easily added. Regards, Federico Miyara On 11/02/2021 04:12, Federico Miyara
wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users window.sci (8K) Download Attachment |
Samuel GOUGEON |
In reply to this post by fmiyara
Dear Federico,
Thank you for the proposal. I am afraid that the "symmetric" and "periodic" flag names are not intuitive to me. Indeed, the generated window is always both periodic and symmetric. It is anyway "algorithmically seen" as periodic (from a spectral point of view), since it is regularly sampled, while regular-sampling and periodicity are FT-dual. The point is that it is either open, or closed (what is rather expected, for a window. Sorry for the (serious) joke :-), with a closing point at the same level as the opening one. I know from where these "symmetric" and "periodic" keyworks come from. But, sorry, i can't resolve myself blindly copy others without discussion. Badly naming things usually become counterproductive, noticeably when teaching (here signal processing). For contribution, Best regards Samuel Le 11/02/2021 à 08:12, Federico Miyara
a écrit :
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Samuel, Like it or not, I guess these keywords come from Matlab, and as Matlab still seems to dominate the market, many people, including those willing to quit Matlab (as I did several years ago), are quite used to those keywords. Other software such as Octave and scipy.signal (Python) adhere to this style, so it is already sort of a standard. "Open" and "closed" might have been an option when there was still no name for the concept, but now it doesn't seem advisable. That some name be intuitive or not may depend on the circumstances one was exposed to that name. I myself find it intuitive enough, or at least not counterintuitive. I'm not sure whether it is correct to say that the generated window is both symmetric and periodic. Probably it is either symmetric or asymmetric, but never periodic per se, since it doesn't repeat itself. It tacitly becomes periodic when used along with an FFT, but just because the FFT assumes a periodic model of the signal, so what "periodic" means is just that its "natural" period is equal to its length. But even this can be challenged: What is the "natural" period of a function? I guess this makes sense mainly in the case of windows that are derived from cosines, such as many of the most successful windows (e.g. Hann, Blackman, Blackman-Harris and several flat-tops) Regards, Federico On 09/04/2021 15:29, Samuel Gougeon
wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Dang Ngoc Chan, Christophe |
Hello,
> De : Federico Miyara > Envoyé : dimanche 11 avril 2021 02:08 > > Like it or not, I guess these keywords come from Matlab, and as Matlab > still seems to dominate the market, many people, including those > willing to quit Matlab (as I did several years ago), are quite used to > those keywords I don't agree with this argument. If a way of doing is wrong, then just keep on going because "everybody does so" is just an argumentum ad populum https://en.wikipedia.org/wiki/Argumentum_ad_populum which is a fallacious argument. Regards. -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Claus Futtrup |
Dear friends
I believe the initial question is related to giving more options to the window functions, such that it can continue how it is today (aka 'symmetric') but also offer alternatives. If these additional options makes sense, and can default such that they are not required (existing code continues to work unaffected), and the additional options are useful and meaningful in a mathematical sense, then I'm all for adding these options. When it comes to naming schemes, then Scilab is not required to strictly follow the Matlab regime. We can choose what we find most correct and concise. In some cases Scilab is 'better' than our competition, which is a pleasure. It is true that some users come from Matlab and sometimes we read Matlab code to convert its functionality into Scilab - in these cases it works perfectly good for me to make a Matlab-to-Scilab translation somewhere in the documentation. Therefore, I hope we can have a good discussion about which name is the most meaningful. With kind regards, Claus On 12-04-2021 09:22, Dang Ngoc Chan, Christophe wrote: > Hello, > >> De : Federico Miyara >> Envoyé : dimanche 11 avril 2021 02:08 >> >> Like it or not, I guess these keywords come from Matlab, and as Matlab >> still seems to dominate the market, many people, including those >> willing to quit Matlab (as I did several years ago), are quite used to >> those keywords > I don't agree with this argument. > If a way of doing is wrong, then just keep on going because "everybody does so" is just an argumentum ad populum > > https://en.wikipedia.org/wiki/Argumentum_ad_populum > > which is a fallacious argument. > > Regards. > > > -- > Christophe Dang Ngoc Chan > Mechanical calculation engineer > > > General > This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
In reply to this post by Dang Ngoc Chan, Christophe
Samuel: As a general concept, you are right ... but with nuances. The problem is deciding when something is really wrong and when it is just a question of opinion or personal preference. It is wrong to say the Earth is flat, no matter how many people say it. But is it right or wrong to call something just a conventional name? For instance: Is it right to call the derivative of a function "derivative"? Probably not, because "derivative" is a general concept which seems to have no relationship with its meaning in math. Probably in its origins it was more related to grammar than to math. But once established for centuries, it wouldn't be convenient to change it on the basis that it is "wrong". By the same token, calling "periodic" a window function obtained from periodic functions (cosines) whose period is equal to its length doesn't seem intrinsically wrong to me. Calling it "closed" would be worse since one immediately thinks either of a closed set, which is not, or a closed curve, which isn't either. But even if we found a better word, changing it would very likely create an unnecessary cognitive dissonance to thousands or millions of practitioners. Anyway, if a much better and cristal-clear word (i.e., whose meaning would be immediately obvious in its context) were found and gained consensus, no problem to use it instead of "periodic". The important thing in my proposal was to include in the window() function the feature, not how we call it. Regards, Federico Miyara On 12/04/2021 04:22, Dang Ngoc Chan,
Christophe wrote:
Hello,De : Federico Miyara Envoyé : dimanche 11 avril 2021 02:08 Like it or not, I guess these keywords come from Matlab, and as Matlab still seems to dominate the market, many people, including those willing to quit Matlab (as I did several years ago), are quite used to those keywordsI don't agree with this argument. If a way of doing is wrong, then just keep on going because "everybody does so" is just an argumentum ad populum https://en.wikipedia.org/wiki/Argumentum_ad_populum which is a fallacious argument. Regards. -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Samuel (and Christophe),
I apologize for mixing up your names. My reply was intended for Christophe, not Samuel. Regards, Federico Miyara -------- Forwarded Message --------
Samuel: As a general concept, you are right ... but with nuances. The problem is deciding when something is really wrong and when it is just a question of opinion or personal preference. It is wrong to say the Earth is flat, no matter how many people say it. But is it right or wrong to call something just a conventional name? For instance: Is it right to call the derivative of a function "derivative"? Probably not, because "derivative" is a general concept which seems to have no relationship with its meaning in math. Probably in its origins it was more related to grammar than to math. But once established for centuries, it wouldn't be convenient to change it on the basis that it is "wrong". By the same token, calling "periodic" a window function obtained from periodic functions (cosines) whose period is equal to its length doesn't seem intrinsically wrong to me. Calling it "closed" would be worse since one immediately thinks either of a closed set, which is not, or a closed curve, which isn't either. But even if we found a better word, changing it would very likely create an unnecessary cognitive dissonance to thousands or millions of practitioners. Anyway, if a much better and cristal-clear word (i.e., whose meaning would be immediately obvious in its context) were found and gained consensus, no problem to use it instead of "periodic". The important thing in my proposal was to include in the window() function the feature, not how we call it. Regards, Federico Miyara On 12/04/2021 04:22, Dang Ngoc Chan,
Christophe wrote:
Hello,De : Federico Miyara Envoyé : dimanche 11 avril 2021 02:08 Like it or not, I guess these keywords come from Matlab, and as Matlab still seems to dominate the market, many people, including those willing to quit Matlab (as I did several years ago), are quite used to those keywordsI don't agree with this argument. If a way of doing is wrong, then just keep on going because "everybody does so" is just an argumentum ad populum https://en.wikipedia.org/wiki/Argumentum_ad_populum which is a fallacious argument. Regards. -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Claus Futtrup |
In reply to this post by fmiyara
Hi Federico
Thank you for being open to finding the
right word.
I think other members of our small
group should also be open.
For me the plurality is not so
important - but let's say it's the wording used in all our
educational books (in English) ... just dig into any Signal
Analysis book, etc., and what we're trying to name here is exactly
that, then it would be bad for Scilab to give it a different name.
Renaming something that is universally defined otherwise is an
uphill battle we cannot win.
Asymmetric window functions is new to
me.I googled about window functions and found (stumbled upon):
Conclusion: Asymmetric window functions
have a purpose. When there's asymmetric windows, then there must
also be symmetric windows.
Here's a short list of symmetric window
functions: https://mathworld.wolfram.com/ApodizationFunction.html
Best regards,
Claus
On 12-04-2021 17:19, Federico Miyara
wrote:
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
In reply to this post by Claus Futtrup
There are several software packages, not only Matlab, that call this concept "periodic", for instance Octave, Scipy (from Python), DADiSP. Regarding the last one, I've found an interesting reference: https://www.dadisp.com/webhelp/mergedProjects/refman2/FncrefFK/FLATTOP.htm Here, along with a description of the function, it mentions that "periodic" can also be called "iso" since there is ISO Standard 18431-1 dealing with vibrations (Mechanical vibration and shock — Signal processing Part 1: General introduction), which seemingly makes some related normative prescriptions. Unfortunately the standard is too expensive for me to even attempt to buy it, but perhaps some member of this list has university access to these Standards. I'm pretty sure that the ISO doesn't suggest that the name of this type of window is "iso", but I'm in doubt whether they call it "periodic" or they just introduce the recommended formula or algorithm. Anyway, "iso" would be even more obscure than "periodic", if only because there are literally thousands of ISO standards and most users probably don't even suspect there is one covering this. Regards, Federico Miyara On 12/04/2021 11:23, Claus Futtrup wrote: > Dear friends > > I believe the initial question is related to giving more options to > the window functions, such that it can continue how it is today (aka > 'symmetric') but also offer alternatives. If these additional options > makes sense, and can default such that they are not required (existing > code continues to work unaffected), and the additional options are > useful and meaningful in a mathematical sense, then I'm all for adding > these options. > > When it comes to naming schemes, then Scilab is not required to > strictly follow the Matlab regime. We can choose what we find most > correct and concise. In some cases Scilab is 'better' than our > competition, which is a pleasure. It is true that some users come from > Matlab and sometimes we read Matlab code to convert its functionality > into Scilab - in these cases it works perfectly good for me to make a > Matlab-to-Scilab translation somewhere in the documentation. > > Therefore, I hope we can have a good discussion about which name is > the most meaningful. > > With kind regards, > Claus > > On 12-04-2021 09:22, Dang Ngoc Chan, Christophe wrote: >> Hello, >> >>> De : Federico Miyara >>> Envoyé : dimanche 11 avril 2021 02:08 >>> >>> Like it or not, I guess these keywords come from Matlab, and as Matlab >>> still seems to dominate the market, many people, including those >>> willing to quit Matlab (as I did several years ago), are quite used to >>> those keywords >> I don't agree with this argument. >> If a way of doing is wrong, then just keep on going because >> "everybody does so" is just an argumentum ad populum >> >> https://en.wikipedia.org/wiki/Argumentum_ad_populum >> >> which is a fallacious argument. >> >> Regards. >> >> >> -- >> Christophe Dang Ngoc Chan >> Mechanical calculation engineer >> >> >> General >> This e-mail may contain confidential and/or privileged information. >> If you are not the intended recipient (or have received this e-mail >> in error), please notify the sender immediately and destroy this >> e-mail. Any unauthorized copying, disclosure or distribution of the >> material in this e-mail is strictly forbidden. >> _______________________________________________ >> users mailing list >> [hidden email] >> http://lists.scilab.org/mailman/listinfo/users > > > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users > > -- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
In reply to this post by Claus Futtrup
Claus, For me the plurality is not so important - but let's say it's the wording used in all our educational books (in English) ... just dig into any Signal Analysis book, etc., and what we're trying to name here is exactly that, then it would be bad for Scilab to give it a different name. Renaming something that is universally defined otherwise is an uphill battle we cannot win. As I implied earlier, nomenclature could hardly be right or wrong since it is mostly arbitrary. But there could be more logical or less logical choices. When it is well established, it is also a battle that is not worth fighting, especially if there is some sort of rationale behind it.
This is another kind of asymmetry. "Periodic" window functions are only slightly asymmetric. I don't think they qualify for the kind of windows treated in that paper. Asymmetric windows seem to be a good choice to smooth out the spectrum if phase response is not important. Scilab doesn't have any asymmetric function, but if a plan to add new windows were approved, they could be included along with several more traditional window functions currently not covered (such as Blackman, Blackman-Harris or a number of flat-tops). Symmetric windows are used for FIR filter design. Periodic windows are used for spectrum analysis. Regards, Federico Miyara
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users |
Free forum by Nabble | Edit this page |