Search the Community
Showing results for tags 'math'.
-
Hi, I'm working in this library with some useful DSP and math functions (ideally focusing on embedded systems). Currently it's in the initial version with few functions, but I hope to add more in the next update. I prefered to use some structs to save parameters and use just one function to various instances of filters (very versatile). Functions - High Pass Filter (Single pole): Float, fixed and fixed extended version (with more bits to fractional part) - Low Pass Filter (Single Pole): Float, fixed, fixed extended and fixed fast (with some limitations related to cuttof freq
-
Can anyone explain why the long variable 'frequency' will not change based on pin status? (loop function) I know I must be doing something wrong but I can't seem to figure it out. The program as written works. I type in for example 7000000 and the DDS programs to 7.0 Mhz. If a pin is pulled low I want to add or subtract 1500. But that part does not work. It always sets the DDS to the input frequency. I've added print statements to verify what is happening and I know the program is detecting pin state OK. so something is wrong with my logic for adding or subtracting. file attache
-
Hi Everyone, I have been looking for about an hour online and haven't been able to find the answers to these questions. - Can I use floating point with the msp4302553 ? the watch expression on CCS don't seems to like floating point for sure. - Can I use math.h to do trigonometry calculus on the msp430g2553 ? Let me tell you guys what I am trying to do so that it is more clear: I am scanning a signal with an ADC. I would like to do an atan() on the signal and output the signal with an DAC. Right now I can scan the signal and send it to the DAC. This works well. But I can't get the t
- 16 replies
-
Hello, i am having problems with math library using energia. I always keep getting thi s error. I dont know whats wrong. Error : http://pastie.org/8127090 Here you can read the source : http://pastie.org/8127093#871-872 I highlighted the lines which are makeing troubles. Its lines 871 and 872, by commenting them you can avoid getting this error. float accel_angle_y = atan(-1*accel_x/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES; float accel_angle_x = atan(accel_y/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;
-
volatile byte revolutions; unsigned int rpmilli; float speed; long gTest; unsigned long timeold; void setup() { Serial.begin(9600); pinMode(PUSH2, INPUT_PULLUP); attachInterrupt(PUSH2, rpm_fun, FALLING); revolutions = 0; rpmilli = 0; timeold = 0; } void loop() { if (revolutions >= 5) { //Update RPM every 20 counts, increase this for better RPM resolution, //decrease for faster update // calculate the revolutions per milli(second) rpmilli = (revolutions/(millis()-timeold)); //** EDIT: it should be revolutions/(millis()-timeold) unsigned long test = mi
-
Just came across this announcement of a math library optimized for MSP430: http://e2e.ti.com/blogs_/b/msp430blog/archive/2013/05/07/mspmathlib-amping-up-the-performance-of-msp430-but-not-the-power.aspx Unfortunately only for MSP430F5xx and F6xx and FRAM devices. Any idea what kind of peripheral these have to accelerate math? MSPMATHLIB maim page here: http://www.ti.com/tool/mspmathlib