element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Cirrus Logic - RPI 2 FFT on streaming audio
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 14 replies
  • Answers 2 answers
  • Subscribers 676 subscribers
  • Views 1727 views
  • Users 0 members are here
  • wolfson
  • logic
  • raspberry
  • python
  • audio
  • pi
  • cirrus
  • 2
  • raspberry_pi
  • fft
  • raspeberry_pi_accessories
  • card
Related

Cirrus Logic - RPI 2 FFT on streaming audio

Former Member
Former Member over 10 years ago

Hi everyone,

My current project is to run constant FFT on an audio stream and output the data to a 3D LED Array. Google 3D LED cubes if you don't know what they are. My cube is more of a rectangular prism, 24x8x8=1536 LED's. I am new to the world of PI and have found the support for the cirrus logic card to be vague, if it wasn't for ppl like ragnar.jensen I'd probably still be stuck (thanks for all the information you've shared).

 

Anyway, currently I am recording 1 second of audio after a 1 second delay. So it takes 2 seconds to get the data / audio.

 

I then perform the FFT on 16384 samples. But this is only 1/3 of the 44000 raw audio samples recorded in the 1 second interval. I then group the frequencies into bands and then scale the amplitudes of those bands into a single byte which represents the bands power. The result of each FFT is 24 bytes, one byte for each band. All this takes 0.1 second.@@@@@

 

It then takes 0.004 seconds to send that data to my PIC, which I had to bit bang through the GPIO's since I couldn't get I2C or UART working.

 

The LED array takes the data and displays the 24x8 bits on the front row, when it receives the next group of data the front row shifts back one row. The LED array displays 3 dimensions, time (each group of data), frequencies and amplitude.

 

Question:

In the arecord command, I would like to erase the delay or change it to 0 seconds and change the minimum record length so I can stream the data at a faster rate to the LED array. Does anybody know how????

 

Answering this would result in a real time graphics equalizer on live audio and a more fluent transition between groups of data (more like a wave travelling away from you).

 

If anybody has an idea on how to achieve this please reply, or share your thoughts.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 10 years ago

    image

    The output of the FFT is grouped into 24 bands, the FC denotes the center frequency. On the far right is the BW. The power level is the average power of the individual frequencies in that band. The final output that is sent to the PIC is a scaled value shown by the equalizer level, note: an Equalizer level of 63 in binary is 0011 1111 which will show an amplitude of 6 LEDs being illuminated on the array.

     

    I ran the python program in the previous post with a 3.5mm audio cable plugged in between my phone and the cirrus logic cards line in. I used an app called "PA tone"  (which is free) to generate a 5000Hz Sine wave tone out of my phone. The results show the tone in the 20th band, with an FC of 4350Hz and a BW of 1899Hz (which is 3400Hz to 5300Hz). I found some noise present in unused bands no matter what frequency I generated. I put that down to noise in the phones output or on the line, poor handling of the FFT output (my fault) and digital noise in single precision numbers which can become collectively significant when summed. But clearly the frequency amplitude of the 5000Hz wave is the most significant.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 10 years ago

    image

    The output of the FFT is grouped into 24 bands, the FC denotes the center frequency. On the far right is the BW. The power level is the average power of the individual frequencies in that band. The final output that is sent to the PIC is a scaled value shown by the equalizer level, note: an Equalizer level of 63 in binary is 0011 1111 which will show an amplitude of 6 LEDs being illuminated on the array.

     

    I ran the python program in the previous post with a 3.5mm audio cable plugged in between my phone and the cirrus logic cards line in. I used an app called "PA tone"  (which is free) to generate a 5000Hz Sine wave tone out of my phone. The results show the tone in the 20th band, with an FC of 4350Hz and a BW of 1899Hz (which is 3400Hz to 5300Hz). I found some noise present in unused bands no matter what frequency I generated. I put that down to noise in the phones output or on the line, poor handling of the FFT output (my fault) and digital noise in single precision numbers which can become collectively significant when summed. But clearly the frequency amplitude of the 5000Hz wave is the most significant.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube