|03 Mar 2015||Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts.||Paul||
|03 Mar 2015||Round to X Rounds the supplied N-D matrix to the values in a supplied array.||Stephen Cobeldick||
Nice work. Very tidy code, and does exactly what it says on the tin.
I agree that the "fix" option does not really make much sense as I originally thought it did. You are correct that it could be quite counter intuitive.
I would give this submission six stars if I could: it is rare to see code on FEX that uses inbuilt functions really effectively: bsxfun and interp1 are perfectly applied in this submission.
|02 Mar 2015||Round to X Rounds the supplied N-D matrix to the values in a supplied array.||Owen Brimijoin||
@Stephen Cobeldick: a revised version has now been posted to the FileEx based on your recommendations. All of them have been implemented, save one: the addition of a 'fix' method. The reason it hasn’t been implemented is that I am not convinced it should be. I can certainly BE convinced, but here’s a scenario for you and the file exchange community to puzzle over:
data = 0.1;
The result of using a ‘fix’ method here would be for the data to be rounded away from zero, to 5.0, which is a bit counterintuitive to the user who has just typed in ‘fix!’
Within the round-to-x framework, ‘fix’ in essence serves two masters, rounding not towards zero, but rather toward the supplied value that has the smallest absolute value. I think it’s confusing, but I’d greatly appreciate thoughts on the subject. I am fully prepared to admit that there may be uses for this code behavior that I am not seeing.
|27 Feb 2015||Round to X Rounds the supplied N-D matrix to the values in a supplied array.||Owen Brimijoin||
Thank you, Stephen, for working this function over and finding the bits that are in sore need of improvement. I was hoping someone might do exactly this! Based on your helpful suggestions, a new version will be forthcoming as soon as I find a spare evening to work on it.
|26 Feb 2015||Round to X Rounds the supplied N-D matrix to the values in a supplied array.||Stephen Cobeldick||
A nice concept that has been tidily implemented using fully vectorized code. The H1 line, examples and a good help section make it easy to search for and use. Clearly documented and commented code make it easy to read through.
This submission is "almost there", but a few points detract from the overall quality:
* Although the author states that the rounding operations "each work the way their .m counterparts do", this is not true for the most critical test-case: an input of 0.5 and a rounding vector of [0,1] rounds down to zero, not up to one like "round" does.
* Use of <varargin> instead of three explicitly named arguments is a major drawback. Naming arguments explicitly means that the code-prompting in the command line and editor would show the names of the arguments, whereas currently it shows the not-very-informative "varargin". It would also simplify the input handling (in the switch statement), as it does not require re-assignment of the variables.
* It needs the addition of 'fix' as an option (this is not the same as floor!).
* Input checking could be improved, e.g. check that <roundvec> is really a vector (this matters, as the code assumes this!), check if <data> is numeric (ditto).
* Either include handling for complex values, or throw an error if the input data is complex.
* The addition of a "See Also" line: this should link to "Round", "Fix", "Floor", etc.
|27 Oct 2014||Kautz sequence generator Generates example Kautz sequences of specified number of characters and subsequence lengths.||Owen Brimijoin||
This example you are showing here seems to me to be a legitimate 3^3 Kautz sequence. Could you explain why you've identified these particular substrings as incorrect?
The condition of the Kautz sequence is not that there be no repeated characters in a substring (in your case, each set of 3), rather that the sequence simply not contain any *consecutive* repeats of the same character.
|25 Oct 2014||Kautz sequence generator Generates example Kautz sequences of specified number of characters and subsequence lengths.||Memoly Memoly||
For the example sequence generated like : 3 1 3 2 1 2 1 3 1 2 3 2
But is that correct?
|17 Sep 2014||de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths.||Owen Brimijoin||
In its current form, no, there is no way to force it to generate all possible 4^2 sequences short of exhaustively running the function in a while loop and checking for unique results until all 16 are generated (not particularly efficient, to put it mildly).
|17 Sep 2014||de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths.||vinod||
Using this code am i able to generate all debruijn sequences?........for example for n=4 and k=2,there are 16 debruijn sequences.
|09 Jul 2014||Round to X Rounds the supplied N-D matrix to the values in a supplied array.||Chang hsiung|
|28 Jun 2013||Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts.||Owen Brimijoin||
Oops.. my mistake, "chirp.m" is only included in the Signal Processing toolbox! I have updated the function to include simple linear and logarithmic sweep options. For these you need to provide a [start stop] vector of frequencies.
To the list of signal options, I have also added brown noise (1/f^2) and grey noise. Mind you, it's a generic grey (ISO Equal-Loudness at 60 phons), since *true* grey noise must be custom defined to match each listener's psychoacoustic loudness contour.
The updated version has been submitted and should pop up soon.
|24 Jun 2013||Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts.||Owen Brimijoin||
I am so glad you find this submission helpful, Deborah. Excellent suggestions, I will certainly add more noise forms as soon as I can compute the best filter coefficients I can. Watch this space for grey noise and brown noise, among others.
I am, however, hesitant to add support for frequency sweeps because I think it would complicate the currently simple input argument structure. What's more, there is the built-in Matlab 'chirp.m' function that does a bang-up job of making fm signals!
|06 Jun 2013||Deborah||
I really like this submission, saved me an awful lot of trouble!
|29 May 2013||de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths.||Owen Brimijoin||
@Mahdiyar - from the error you are getting, I'd guess that you haven't put the m-file in a directory that Matlab knows anything about. Either use addpath or place the file in your current directory and it should work just fine.
|24 May 2013||Mahdiyar||
I run the code attached at this page but it gives me the following error
>> sequence = debruijn_generator(3,2)'
|19 Aug 2011||Owen Brimijoin||
It’s a bit of a needle-in-the-haystack problem. While it’s true there are many valid (k,n) de Bruijn sequences (this many: factorial(k)^(k*(n-1))/k*n), there are k^(k^n) possible ways to combine k characters in a sequence of equal length!
This m-file keeps a *simple* history of dead-ends in its attempt to find a valid sequence, the simplicity of it being an advantage in avoiding out-of-memory problems, but I do not doubt there are better ways to do it. Suggestions are most definitely appreciated!
|16 Aug 2011||Alex||
000 0 Do
0000 0 Do
000000 0 Do
|29 Jul 2011||fan||
I have another question.Since this function generates the requierd DB sequence through searching all the possible symbol combinations according to the character, arbitrary DB sequence can be obtained without regard to the limitaion of time and memory in principle. However, the generation of the sequence with large period is rather timing consuming. The command 'debruijn_generator(4,8)' gived no result after running for 8 hours. Any sugestions for this problem? Thank you very much.
|29 Jun 2011||Owen Brimijoin||
In principle you could reseed Matlab's random number generator to the same value each time:
These ought to be the same. On the other hand, there is no reason you could not simply save a given sequence and load it whenever you need it.
|01 May 2011||fan||
Thank you for author's kind sharing. But how to obtain the same DB sequence each time?