Displaying 4 results from an estimated 4 matches for "square1".
Did you mean:
square
2007 Aug 15
2
pcspkr wave encoding
...t. The two numerical
parameters a and b denote the square and sine rate.
# 0:1 rate <=> 0% square, 100% sine generation
$ ./sd ihold.sd 0 1 | sox -r48000 -s -w -t raw - ihold-sine.wav
# 1:2 rate <=> 33% square, 66% sine generation
$ ./sd ihold.sd 1 2 | sox -r48000 -s -w -t raw - ihold-square1-sine2.wav
# 1:0 rate <=> 100% square, 0% sine generation
$ ./sd ihold.sd 1 0 | sox -r48000 -s -w -t raw - ihold-square.wav
Now this is what happens when encoding to FLAC:
$ flac -8 ihold-sine.wav
ihold-sine.wav: wrote 2422225 bytes, ratio=0.353
$ flac -8 ihold-sine2-square1.wav
ihold-sin...
2007 Aug 15
0
pcspkr wave encoding
...nd b denote the square and sine rate.
>
> # 0:1 rate <=> 0% square, 100% sine generation
> $ ./sd ihold.sd 0 1 | sox -r48000 -s -w -t raw - ihold-sine.wav
>
> # 1:2 rate <=> 33% square, 66% sine generation
> $ ./sd ihold.sd 1 2 | sox -r48000 -s -w -t raw -
> ihold-square1-sine2.wav
>
> # 1:0 rate <=> 100% square, 0% sine generation
> $ ./sd ihold.sd 1 0 | sox -r48000 -s -w -t raw - ihold-square.wav
>
> Now this is what happens when encoding to FLAC:
>
> $ flac -8 ihold-sine.wav
> ihold-sine.wav: wrote 2422225 bytes, ratio=0.353
>...
2009 Jul 09
5
Best way to export values from a function?
Maybe there is a great website out there or white paper that discusses this but again my Google skills (or lack there of) let me down.
I would like to know the best way to export several doubles from a function, where the doubles are not an array.
Here is a contrived function similar to my needs:
multipleoutput<-function(x)
{
squared<-x^2
cubed<-x^3
exponentioal<-exp(x)
2009 Jul 09
2
How to Populate List
...re = x^2, cube = x^3, exp = exp(x))) }
But then you'd have to call it like so:
> mapply(multipleoutput, c(0,1,2))
[,1] [,2] [,3]
square 0 1.000000 4.000000
cube 0 1.000000 8.000000
exp 1 2.718282 7.389056
If you call it like so:
> multipleoutput(c(0,1,2))
square1 square2 square3 cube1 cube2 cube3 exp1 exp2
0.000000 1.000000 4.000000 0.000000 1.000000 8.000000 1.000000 2.718282
exp3
7.389056
then R flattens the result. Weird.
- Godmar
------------------------------
Message: 131
Date: Thu, 9 Jul 2009 00:35:08 +0100
From: tzygmun...