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
    About the element14 Community
  • 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 Problem with a transient signal (record audio file)
  • 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 Not Answered
  • Replies 5 replies
  • Subscribers 705 subscribers
  • Views 953 views
  • Users 0 members are here
  • raspberry_pi
  • raspeberry_pi_accessories
  • cirrus logic audio card
Related

Problem with a transient signal (record audio file)

chema_at
chema_at over 10 years ago

Hello,

 

I am having problems when I record an audio file,  because a transient signal appears,  as shown in the following image. 

I have two Raspberry Pi2 Model B with two Cirrus Logic Audio Card.  The first Raspberry is used to play a audio file, and the second  is used to record this audio file. In the First it used the Line_Out, and the second the Line_In. I am using the commands "aplay" and "arecord".

My problem is transient signal appearing when I record an audio file.

In the following images is showing the original file and the record file.

 

imageimage

 

Example1:Original File. Line Out (First Raspberry)

Example1: Record file in second raspberry

cfdfdf

 

imageimage
Example 2. Original File.Line Out (First Raspberry)

 

Example 2. Record file in second raspberry.

 

Please, I need help to solve the problem.

 

Regards,

 

Jose

  • Sign in to reply
  • Cancel
  • michaelkellett
    0 michaelkellett over 10 years ago

    I'm not sure why it's a problem so this may not help too much:

     

    1) you could try cutting the first half a second off the record file.

     

    2) Many audio ADCs have a large DC offset and use  a digital high pass filter to remove it - it looks as if the RPi setup you have is only starting the ADC when you start the recording. If you start  a recording very soon after stopping  a previous recording do you still get the problem ?

    The proper solution (if my guess about the error is correct) is to start up the ADC and let it settle before actually recording data - but this would require close control of the ADC which you may not have (without changing the driver code). You might be able to turn the high pass filter off - this will give you a DC offset which you could remove with software.

     

    Do you have to use the RPi/Cirrus card combo ?

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • chema_at
    0 chema_at over 10 years ago in reply to michaelkellett

    Hello Michael,

     

    My system wants to analyze the transmission channel,for this,  it is compared  an original file with the recorded file. At the same instant, playback and recording begins. The recorded file cannot be manipulated (it not possible try cutting the first half second) .

     

    To setup the LineIn  (in second raspberry), it is necessary  to execute the script  "Record_from_lineIn.sh"

     

    File:  Record_from_lineIn.sh

     

    #!/bin/bash

    # $1 added to support 1st line argument. i.e. "./Record_from_linein.sh -q" will stop all the control information being displayed on screen

     

    #Record from onboard Line Input to AP

    # +8dB input PGA gain

    amixer $1 -Dhw:sndrpiwsp cset name='IN3L Volume' 8

    amixer $1 -Dhw:sndrpiwsp cset name='IN3R Volume' 8

     

     

    # better THD in normal mode vs lower noise floor in high performance

    amixer $1 -Dhw:sndrpiwsp cset name='IN3 High Performance Switch' on

     

    # Configure the input path for 0dB Gain,  HPF with a low cut off for DC removal

    amixer $1 -Dhw:sndrpiwsp cset name='IN3L Digital Volume' 128

    amixer $1 -Dhw:sndrpiwsp cset name='IN3R Digital Volume' 128

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF1 Input 1' IN3L

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF2 Input 1' IN3R

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF1 Mode' High-pass

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF2 Mode' High-pass

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF1 Coefficients' 240,3

    amixer $1 -Dhw:sndrpiwsp cset name='LHPF2 Coefficients' 240,3

     

    # Configure the Audio Interface and volume 0dB

    amixer $1 -Dhw:sndrpiwsp cset name='AIF1TX1 Input 1' LHPF1

    amixer $1 -Dhw:sndrpiwsp cset name='AIF1TX1 Input 1 Volume' 32

    amixer $1 -Dhw:sndrpiwsp cset name='AIF1TX2 Input 1' LHPF2

    amixer $1 -Dhw:sndrpiwsp cset name='AIF1TX2 Input 1 Volume'

     

     

    I think that a high pass it setup, but I don´t know if  it necessary to setup any more to eliminate the transient signal.

     

     

    Regards .

     

    Jose

    Attachments:
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • DAB
    0 DAB over 10 years ago

    It looks like you have a capacitance component on your analog to digital converter.

     

    You can have these types of events if you have a large stray capacitance caused by the input wires.

     

    Are your audio input lines terminated?

     

    You night have too much signal driving the device, which allows the off nominal signal to be higher than your signal ground.

     

    Do some poking around your input device and look at the states before and after you begin to record.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 10 years ago in reply to chema_at

    There is a link to an earlier discussion here which tells you how you might adjust the High Pass filter:

     

    DC offset on microphones and workaround.

     

     

    or you could try to remove the DC offset at the line input.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • chema_at
    0 chema_at over 10 years ago in reply to DAB

    Thank you DAB and Machael for your answers.

     

    Regards.

     

    Jose.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube