Jump to content

Search the Community

Showing results for tags 'math'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 6 results

  1. agaelema

    DSP and Math lib

    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 frequency, but more efficienty. - RMS value: calculate RMS value of an array or sample by sample. Currently using square root function of math.h, but in the next update I will add a optimized version. I hope this can be useful. Feel free to test, share and contribute with this project. Github: https://github.com/agaelema/DSP_and_Math
  2. 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 attached: AD9850controller3.ino
  3. 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 trigonometric conversion to work. Is it possible to do it? And if yes could I get a little help from you guys ? Thanks in advance for your help. Thomas PS: I saw about these Qmath functions that came out recently but couldn't get it to work either http://www.ti.com/tool/MSP430-iqmathLIB?DCMP=ep-mcu-msp-iqmath-en&HQS=ep-mcu-msp-iqmath-pr-sw2-en
  4. rycco

    Math lib problem

    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;
  5. 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 = millis()-timeold; gTest = 5/(timeold); // WHEELCIRC = 2 * PI * radius (in meters) // speed = rpmilli * WHEELCIRC * "milliseconds per hour" / "meters per kilometer" // simplify the equation to reduce the number of floating point operations // speed = rpmilli * WHEELCIRC * 3600000 / 1000 // speed = rpmilli * WHEELCIRC * 3600 // speed = rpmilli * 2.6958 * 3600; Serial.println(test,DEC); Serial.println(gTest,DEC); Serial.println(timeold); Serial.println(millis()); Serial.print("RPM:"); Serial.print(rpmilli * 60000,DEC); Serial.print(" Speed:"); Serial.print(speed,DEC); Serial.println(" kph"); Serial.println(""); timeold = millis(); revolutions = 0; gTest = 0; } } void rpm_fun() { revolutions++; } Ok, so I have been beating my head against a wall for hours on this. This line: gTest = 5/(timeold); Shows a 0 on the serial monitor everytime. Now I think I have tried just about every data type for gTest that I can think of and that doesn't seem to change anything. If I multiply instead of dividing the two values, it works just fine...however dividing doesn't work. Any ideas? Obviously, test and gTest are for testing. Using PUSH2 for the interrupt is just a test until my hall effect sensors get here (today). I am working on a computer for my bicycle and need to determine speed. Neither value is negative, nor are they 0, so is it some kind of overflow? If I have made some simple mistake, I would be glad to know what it is so that I don't do it again :-) L293D
  6. chicken

    MSPMATHLIB math library

    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
×