<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: A code profileing for maple tutorial would be awsome!</title>
		<link>http://forums.leaflabs.com/topic.php?id=590</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22:10 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=590" rel="self" type="application/rss+xml" />

		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3271</link>
			<pubDate>Fri, 31 Dec 2010 08:14:25 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3271@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;32 and more samples = exponentialy longer time to process 32 seconds for 32 channels and 100 samples on a i5 laptop running win xp. So maby other methods of emg decomposition or emg decoding would work gausian methods might  be faster and I have a gadgetfactory fpga papilio board that and the maple or the oak when it is out might work...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3267</link>
			<pubDate>Thu, 30 Dec 2010 16:05:12 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3267@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;when I edit the number of samples to 64 in testJnS.c and lower the number of samples the program apears to sit.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3266</link>
			<pubDate>Thu, 30 Dec 2010 16:03:56 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3266@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I got it to profile on a laptop here are the results:&#60;br /&#62;
Compile:&#60;br /&#62;
gcc -Wall -lm Matutil.c testJnS.c JnS.c -o JnS.exe&#60;br /&#62;
Run:&#60;br /&#62;
JnS.exe&#60;br /&#62;
Check Profileing.&#60;br /&#62;
gprof JnS.exe&#60;br /&#62;
.07 seconds 14hz
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3265</link>
			<pubDate>Thu, 30 Dec 2010 14:14:56 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">3265@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;The random data would tell me if I can use the maple or if I am completly unable to use the maple for that&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;As long as the Blind Source Seperation algorithm isn't too data dependent, random data might be fine.&#60;br /&#62;
My only concern is the run time of the algorithm might rely on a (relatively) continuous signal, well below the Nyquist limit. Something that looks more like real data would avoid that problem.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3262</link>
			<pubDate>Thu, 30 Dec 2010 12:09:52 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3262@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Well the sensor setup I am still working on the kicad files for and the design I was thinking of shoveling the data up a high speed usb port using a ft2232h module.&#60;br /&#62;
Then the maple would be used to clock the data and to load the sensors registers.&#60;/p&#62;
&#60;p&#62;The only osiliscope I have is my dads and it was his fathers and made with tubes as a kit. &#60;/p&#62;
&#60;p&#62;The random data would tell me if I can use the maple or if I am completly unable to use the maple for that and need to use a laptop or chumby hacker board. I hope I don't have to use the CHB because they don't have as good documentation as the maple. I haven't seen a GPIO tutorial on it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3261</link>
			<pubDate>Thu, 30 Dec 2010 11:59:45 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">3261@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I was proposing something a bit more direct.&#60;/p&#62;
&#60;p&#62;If the code is designed to take samples in and generate some values out within some real-time limits, I was suggesting just doing a pin toggle and timing it on every sample in or out (which ever is less frequent). That would correspond to your example of sampling audio, and generating new audio values out. That case isn't a batch process. &#60;/p&#62;
&#60;p&#62;Taking a bunch of random numbers might be so far away from a sampled audio stream (obeying Nyquest, or more stringent requirements) that it might be meaningless.&#60;/p&#62;
&#60;p&#62;BUT, if you can arrange to have the code process random samples, and that is meaningful, and just time how long it takes, then that is very straightforward.&#60;/p&#62;
&#60;p&#62;It is straightforward to see how fast something is to a reasonable accuracy, i.e. better than 10%. Oscilloscopes will do that. The crystal on the Maple will be better than 10%. So you could use one of its own hardware timers with reasonable pre-scaler to count elapsed time. Set the counter to 0 at the start, run the code, and look at the count at the end.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3259</link>
			<pubDate>Thu, 30 Dec 2010 11:03:57 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3259@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Goal: to find how long this Blind Source Seperation code takes to run worst case senario so random 24 bit data could be generated and stored as a array in ram.&#60;/p&#62;
&#60;p&#62;the BSS c code is here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://perso.telecom-paristech.fr/~cardoso/guidesepsou.html&#34; rel=&#34;nofollow&#34;&#62;http://perso.telecom-paristech.fr/~cardoso/guidesepsou.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It is not mine and I can't find a math tutor who can explain BSS to me in calc 2 or less terms.&#60;/p&#62;
&#60;p&#62;Plan: &#60;/p&#62;
&#60;p&#62;Generate random data:&#60;br /&#62;
The data is 24 bits in size filling 32 bit ram pieces because that is what the maple uses.&#60;br /&#62;
use analog to create seed generate data... representing 8 24 bit values comeing 16k/s.&#60;/p&#62;
&#60;p&#62;configure sources header files for 32 bit data.&#60;/p&#62;
&#60;p&#62;gprof profileing outputs a file after the program is run that seems to be a operating system thing proably microseconds before function call and after would have to be used.&#60;/p&#62;
&#60;p&#62;run function and send time it took checking for overflow to virtual com port.&#60;br /&#62;
increse the number of samples till sampleing and data rate ar close if this can be done at all. &#60;/p&#62;
&#60;p&#62;repeat the same call and check for different ammounts of time for different random number sets. &#60;/p&#62;
&#60;p&#62;So what your saying as a plan would be something like...&#60;/p&#62;
&#60;p&#62;Run the BSS code on the maple starting with 10 samples.. have the maple run that 1000 times from random data and have it report how long it took.&#60;/p&#62;
&#60;p&#62;then increse the number of samples by a counter and have it run thowse 1000 times and find how many samples I can take and have the maple respond to the next data packet.&#60;br /&#62;
1/16000th of a second is how long till the next piece of data can be clocked into the maple maby that could be by interupt... &#60;/p&#62;
&#60;p&#62;this might also be a job for the larger ram maple chip replacement if the maple can do this. It is realy hard to tell how fast this is...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3258</link>
			<pubDate>Thu, 30 Dec 2010 10:29:56 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">3258@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm not sure I understand how you want to do the profiling, or what you want to get out of it.&#60;/p&#62;
&#60;p&#62;Do you want to run a emulator on your PC, and get some information from it?&#60;br /&#62;
Or do you want to run on the Maple's STM32F103, and get some information from it?&#60;br /&#62;
What is the information you want?&#60;/p&#62;
&#60;p&#62;Have you got access to an oscilloscope?&#60;/p&#62;
&#60;p&#62;Assuming the program is processing a real time data stream, flowing from some inputs to some outputs, I'd be tempted to add a little extra code.&#60;/p&#62;
&#60;p&#62;The extra code could be on the input or output side of the application. All it's tryung to do is establish a timing marker. For example it could toggle an unused digital pin up or down each time it executes. Measure that on an oscilloscope. It'd show frequency information, which is the time to run through all the code, and the mark-space ratio would indicate if the code runs at a very consistent rate. A storage scope would let you look at this in detail, but an ordinary scope would let you see the frequency, and hence 1/duration.&#60;/p&#62;
&#60;p&#62;I did some experiments and generated a square wave at about 12MHz out of C (I'll try to remember to check). Maple's STM32F103 can generate higher frequencies but the code is a bit specialised, and less use for this. &#60;/p&#62;
&#60;p&#62;Assuming the sample data rate is significantly lower, i.e. less than 1MHz, then this should represent less than 10% impact. This may work okay for an initial test, and maybe enough for your purposes. &#60;/p&#62;
&#60;p&#62;If you have a signal analyser, you could probably do better, but I don't have one (yet:-).&#60;/p&#62;
&#60;p&#62;If you had a second Maple, you could take the generated square wave in as an external timer signal, and measure the average over some period (maybe stacking timers for longer time periods). This would give an overall average. Depending on what the application does, you may not need a second Maple, but just use timers in one. This would take a bit more care as it could easily introduce a 'Heisenberg effect', distorting the outcome.&#60;/p&#62;
&#60;p&#62;You could go further with a second Maple, but it really depends what it is you want to know. An STM32F is quite a powerful analysis tool.&#60;/p&#62;
&#60;p&#62;&#60;em&#62;Edit - I believe I decided the maximum frequncy was 9MHz if the address of the pin needs to be loaded (the 12MHz got the address loaded once), and that might flush a register. I think a single high/low pulse would have lower overall overhead than toggling each time round.&#60;/em&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "A code profileing for maple tutorial would be awsome!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=590#post-3255</link>
			<pubDate>Wed, 29 Dec 2010 23:44:52 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">3255@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;A code profileing for maple tutorial would be awsome!&#60;br /&#62;
I have standard c code that is gpl licenced by someone else.&#60;br /&#62;
The example runs on my pc I compiled it.&#60;br /&#62;
But I would like to know if it can run on a maple in realtime based on the rate the maple gets in the information.&#60;/p&#62;
&#60;p&#62;I am shure this would be useful for other people who would turn the maple into audio effects gadgets because their is audio effects code out there and would like to input c code to it. &#60;/p&#62;
&#60;p&#62;So the arduino interface is great and is gcc c sorta.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
