Search Comments and Ratings

go

   
Date File Comment by Comment Rating
03 Mar 2015 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin Paul

Paul (view profile)

Thank you!

5
03 Mar 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin 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.

5
02 Mar 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin 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;
roundvals = [-10, 5, 10];

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.

Comment only
27 Feb 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin 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.

Comment only
26 Feb 2015 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin 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.

4
27 Oct 2014 Kautz sequence generator Generates example Kautz sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@memoly

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.

Comment only
25 Oct 2014 Kautz sequence generator Generates example Kautz sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Memoly Memoly

For the example sequence generated like : 3 1 3 2 1 2 1 3 1 2 3 2

But is that correct?
313-wrong
132
321
212-wrong
121-wrong
213
131-wrong
312
123
232-wrong
323
231

Comment only
17 Sep 2014 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@vinod

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).

Comment only
17 Sep 2014 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin vinod

vinod (view profile)

Using this code am i able to generate all debruijn sequences?........for example for n=4 and k=2,there are 16 debruijn sequences.

Comment only
09 Jul 2014 Round to X Rounds the supplied N-D matrix to the values in a supplied array. Author: Owen Brimijoin Chang hsiung

5
28 Jun 2013 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin 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.

Comment only
24 Jun 2013 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin 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!

Comment only
06 Jun 2013 Oscillator and Signal Generator A simple command-line function for generating standard waveforms, click trains and noise bursts. Author: Owen Brimijoin Deborah

Deborah (view profile)

I really like this submission, saved me an awful lot of trouble!
However, while you're at it, I would love if there were more waveforms available, like a swept sine (linear sweep, exponential... but I think this does exist somewhere on FE) or different noise forms like grey noise (weighted with an inverse A-Filter).
The function is documented nicely and has a helpful help section.

5
29 May 2013 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin 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.

Comment only
24 May 2013 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Mahdiyar

I run the code attached at this page but it gives me the following error

>> sequence = debruijn_generator(3,2)'
Undefined function 'debruijn_generator' for input arguments of type
'double'.
Please let me know what should I do.

Comment only
19 Aug 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

@fan

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!

Comment only
16 Aug 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Alex

Alex (view profile)

2D-key 0011

000 0 Do
001 1 Re
011 2 Mi
111 3 Re
101 2

(1*sqrt(0)+1*sqrt(1)+2*sqrt(2)+1*sqrt(3))*2/4=pi

3D-key 00010111

0000 0 Do
0001 1 Mi
0101 2 Re
0111 3 Mi
0011 2 Fa
1011 3 Re
1001 2 Mi
1101 3 Re
1111 4

(1*sqrt(0)+1*sqrt(1)+3*sqrt(2)+3*sqrt(3)+1*sqrt(4))*2/8=pi

5D-key 00000101100100011101010011011111

000000 0 Do
000001 1 Mi
000101 2 Re
000111 3 So
010111 4 Fa
011111 5 Mi
011011 4 Re
011001 3 So
001001 2 Do
001000 1 Mi
001100 2 Fa
000100 1 So
010100 2 Re
010110 3 Mi
010010 2 Fa
011010 3 So
001010 2 La
101010 3 Fa
100010 2 So
110010 3 Re
110000 2 Mi
110100 3 Fa
111100 4 So
101100 3 Re
101110 4 La
001110 3 Fa
000110 2 Mi
000010 1 Re
000000 0 So
010000 1 Fa
011000 2 Mi
011100 3 Re
011110 4

(2*sqrt(0)+5*sqrt(1)+10*sqrt(2)+10*sqrt(3)+5*sqrt(4)+1*sqrt(5))*2/31=pi

Comment only
29 Jul 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin fan

fan (view profile)

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.

Comment only
29 Jun 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin Owen Brimijoin

In principle you could reseed Matlab's random number generator to the same value each time:

rand('seed',0);
sequence1 = debruijn_generator(5,3)
rand('seed',0);
sequence2 = debruijn_generator(5,3)

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.

Comment only
01 May 2011 de Bruijn sequence generator Generates example de Bruijn sequences of specified number of characters and subsequence lengths. Author: Owen Brimijoin fan

fan (view profile)

Thank you for author's kind sharing. But how to obtain the same DB sequence each time?

Comment only

Contact us