On 05/10/2012 07:06 AM, Mike Miller wrote: > On Thu, May 10, 2012 at 4:17 AM, Daniel J Sebald<daniel.seb...@ieee.org> > wrote: >> On 05/10/2012 01:12 AM, Mike Gross wrote: >> >>> I had been using my local copy of the blackmanharris function and didn't >>> realize that my patch was not applied. >>> >>> I think that the root issue is that the previous implementer of some or >>> all of the window functions assumed that the periodic output was the >>> correct behavior. My bias is to match MatLab behavior which I assume >>> produces symmetric coefficients. Has this been verified? > > Depends on your version :) I have a version that generates DFT-style > windows for some (blackmanharris and nuttallwin) and symmetric > filter-style windows for the others. The most up-to-date ML docs on > the web indicate that the symmetric|periodic argument has been added > to these and the default switched to symmetric for those that weren't. > I think this newest behavior is what we are saying we should achieve. > >>> My intention had been to ensure that all of the window functions >>> returned symmetric coefficients and valid values for integer lengths >>> greater than zero but somewhere along the line it fell off of my radar. >>> It seems like James, Daniel and Mike are on top of this but I could >>> easily assist if it seems worthwhile. >> >> >> OK. I think there is a start on this from Peter: >> >> http://www.mail-archive.com/octave-dev@lists.sourceforge.net/msg01576.html >> >> that attempts the "periodic" and "symmetric" distinction. I suggest one of >> us freshen that patch with the current SVN source and attach it to a bug >> report. Once we agree on the behavior and appearance of welchwin.m then >> we'll search for several windows of the same nature and do a similar mod. >> When we're done we'll move the patch with all changes into SVN. > > Dan, just to clarify, are you saying there are fixes to be made to > welchwin or are you saying this should be the gold standard to use as > a starting point for the others?
Fixes and cleaning up. > I think it looks mostly complete, here's what I'd change: > * tweak the arg 2 parsing a bit (get rid of unnecessary size and > isempty, use strncmp, rearrange) Yes. Use the strcmp and routines for getting the index without all the conditional statements. Essentially the same thing, but using the versatile commands of the language cleans things up. > * allow any L>0 (I see Peter's argument about utility but there is a > valid answer for L=1 or 2) I agree. Even if length is 1 and is an uneventful window, it still meets the definition of symmetry and circular periodicity. No reason to rule those out. > * return a column vector I'm OK with that. > * add test cases Tests are good. All that is needed I think is a case which has enough variation, then test something like for N=8:9 w = welchwin(N, 'symmetric'); if sum(w - flipud(w)) > eps error('Failed symmetry test'); end end Or whatever similar error mechanism is used in those demo scripts. >> I suggest adding some test cases in the script files to verify it is in fact >> symmetric or period depending on the choice. I demo that plots side by side >> the spectral characteristics of the two types might be nice. It would help >> the user understand the difference between the two options. > > Good idea. > > In the mean time I've already updated all window functions to have the > same length argument name and started updating the help text, > especially for those that don't have properly formatted help. OK, thank you. What about the names of the files? "welch" would be fine for me. Once someone has done enough DSP-like work, it becomes clear "welch" is a window without needing the "win" appended to the name. Dan ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev