© Analog Devices Inc. Application Notes | August 27, 2021
LTspice Audio WAV Files: Using Stereo and Encrypting Voice Messages
Question: Can you utilize stereo data and encrypt voice messages with LTspice audio WAV files?
Answer: If music be the food of love, simulate on. This RAQ explains how to use LTspice® audio WAV files for the syntax of stereo (and higher channel count). LTspice can be used to generate WAV files as an output of a circuit simulation as well as import WAV files to excite a circuit simulation. It is well documented that mono WAV files can be used as an input in LTspice, and LTspice can be used to produce a WAV output. This article details how to use LTspice audio WAV files for the less well-known syntax of stereo (and higher channel count). LTspice has many superpowers, but its handling of audio files is one of its more impressive talents. While it is fascinating to see a circuit come to life on the computer screen, creating a sound file that can be played outside of LTspice enables engineers to use another sense to evaluate simulations. Using mono LTspice audio WAV files is well documented. This article expands the discussion to stereo (or more channels), and shows how to export stereo data from, and import it to, LTspice via WAV files. It also illustrates a few tips and tricks with WAV files that will enable the reader to further utilize WAV files. Generating a Stereo WAV File Let’s start by producing a stereo wave file from a mono signal. Figure 1 shows a circuit that generates a 1 V, 1 kHz sine wave and splits it into two channels, alternating the signal between them—the 1 kHz tone is switched in 2-second intervals between CH1 and CH2. Figure 1. In this simulation, a 1 kHz sine wave is switched in two-second intervals between CH1 and CH2. The resulting two-channel signal is exported to an audio WAV file. The command .wave “C:\export.wav” 16 44.1k V(CH1) V(CH2) digitizes each channel with 16-bit resolution, sampled at 44.1 kSPS, and stores the resultant audio in C:\export.wav. In the command above, each signal listed after the sample rate becomes its own channel in the WAV file. LTspice can store as many as 65,535 channels in a single LTspice audio WAV file—just append signals to the above command as desired. Figure 2. The two stereo channels from export.wav are used to stimulate two independent circuits. By default, LTspice’s .wave command saves the first listed channel as the left audio channel and the second as the right audio channel. In this case, when export.wav is played back through a media player, CH1 will be read as the left channel and CH2 will read as the right, regardless of the circuit node naming convention. Note that, by default, CH1 and CH2 are stored as chan 0 and chan 1, respectively, in the .wav file, which is important for reading the file discussed below. This exported stereo audio file can be used to stimulate another circuit, shown in Figure 2, which uses the two channels from export.wav as signal inputs. The voltage sources, V1 and V2, are placed as usual, then the voltage signals from export.wav are assigned by holding down the CTRL key and right clicking over each voltage source, revealing the Component Attribute Editor as shown in Figure 3. Figure 3. Stereo signals from export.wav are used as inputs to the circuit of Figure 2. Here is the assignment for V1, with the value set to pull Channel 0 from export.wav. As mentioned above, when the LTspice audio WAV file is first generated, as many as 65,535 channels can be digitized into one WAV file—simply append as many channels as desired onto the end of the .wave command. Remember, by default, LTspice names the first channel Channel 0, the next one is named Channel 1, and so on. In this case, export.wav (generated by the simulation in Figure 1), stores the voltage V(CH1) as Channel 0 and V(CH2) as Channel 1. To play back these channels using a voltage source, specify the .wav file and channel in the value line of the voltage source. In this case:
- To instruct V1 to replay Figure 1’s V(CH1): wavefile=“C:\export.wav” chan=0
- To instruct V2 to replay Figure 1’s V(CH2): wavefile=“C:\export.wav” chan=1
Potential government-mandated lockdown to affect Bourns Xiamen facility An outbreak close to the BXL Xiamen facility or a single positive case within the BXL Xiamen facility could result in a 14-day mandatory lockdown of the facility, wrote the company on September 24, 2021.
Intel has broken ground on its massive expansion in Arizona The USD 20 billion capacity expansion will bring Intel’s total Arizona investment to more than USD 50 billion.
LPKF adjusts Q3 guidance due to logistics bottlenecks Due to delays caused by current bottlenecks in global outbound logistics to China and a customer project delay in China, LPKF Laser & Electronics AG concluded, that systems produced and ready for delivery worth approximately EUR 7 million will likely not be shipped before month end.
Kendrion acquires electronics and embedded developer Dutch Kendrion N.V., a developer, manufacturer and marketeer of high-quality electromagnetic systems and components for industrial and automotive applications, has acquired 3T, a Netherlands-based software and electronics development company.
Energy storage using supercapacitors: How big is big enough? Question: Can I use a simple energy calculation when selecting a supercapacitor for a backup system?
Sponsored content by Shenzen Kinwong ElectronicThe development trend of printed circuit board products and Kinwong's solution With the rapid development of electronic technology in recent years, printed circuit board (PCB) products are pursuing higher heat dissipation capabilities, with high voltage and high current characteristics, and are developing towards high-density interconnection technology (HDI).
Weebit and SkyWater to take ReRAM tech to volume production Weebit Nano, a developer of next-gen memory technologies for the semiconductor industry, has entered into an agreement with semiconductor foundry SkyWater Technology to take Weebit’s Resistive RAM (ReRAM) technology to volume production.
Excelitas Technologies opens new plant in Germany The industrial technology manufacturer has opened a new plant for its German subsidiary, Qioptiq Photonics GmbH & Co. KG, in Göttingen, Germany. The new facility expands the company’s capacity for assembly of highly sophisticated optomechanical systems and components for the semiconductor industry.
Sponsored content by ICAPE GroupICAPE Group opens its virtual booth! On October 4th and 5th, ICAPE Group organizes a great virtual meeting in an interactive 3D environment. A new digital experience which will plunge you into the ICAPE Group universe, to know everything about printed circuits, technical parts and to exchange live with the group experts.
Sanmina strengthens its optical, RF and microelectronics capabilities Sanmina says it is strengthening its focus on its optical, radio frequency (RF) and microelectronics (microE) design and manufacturing capabilities to capitalise on growing demand for highly-integrated technology products with the formation of a new division.
Swiss lighting company opens new factory in Serbia Swiss lighting solutions specialist, Regent Lighting, has just recently opened a new factory in Svilajnac, central Serbia.
Picosun invests in future with its Innovation Lab Picosun Group has taken into use new facilities at its production laboratory in Kirkkonummi, Finland. The Picosun Innovation Lab will be used for the company's own research and development projects, for demo purposes and most importantly for serving the company's global semiconductor customers operating in the 300 mm market.
Infineon & Blixt collaborate to accelerate growth of SSCB's Infineon Technologies and Swedish company Blixt Tech AB have entered an agreement to co-develop solid state circuit breakers (SSCB) based on Infineon's product portfolio.
Mouser continues to invest in automation Mouser Electronics continues to invest heavily in automation in its global distribution center to increase order processing, accuracy and speed.
pSemi expands its footprint with new Taiwan branch office pSemi Corporation, a Murata company focused on semiconductor integration, is opening a branch office in Taipei City, Taiwan. The Taiwan office joins other pSemi APAC locations in India, Korea, China and Japan.
Sponsored content by SAKINext-Generation AOI with Advanced Z-Axis Control Discover how for even the most demanding high-end manufacturing requirements you can achieve the most effective, safe and reliable automated in-line 3D X-ray inspection that delivers clear and detailed images, ensures fast response time and lowers the cost of human intervention and maintenance.
Growatt and TI set up joint lab in China Aiming to promote sustainable energy applications, Growatt, a suppler of inverters, has set up a joint laboratory with Texas Instruments (TI) in the city of Shenzhen, China.
NA semi equipment industry posts August 2021 billings North America-based semiconductor equipment manufacturers posted USD 3.65 billion in billings worldwide in August 2021, according to SEMI.
Melexis expands operations with a new facility in Bulgaria The microelectronics engineering company says that it will open its new production and R&D facility to extend the current location in Gorublyane, Sofia, during the current month.
Sensirion opens new European production site Sensirion’s new subsidiary in Debrecen, Hungary was completed at the end of July this year. This new production site is a strategic expansion, meaning existing jobs in Switzerland or at other sites will not be affected.
Brooks to sell its Semiconductor Solutions Group business Brooks Automation has entered into a definitive agreement to sell its Semiconductor Solutions Group business to Thomas H. Lee Partners, L.P. for USD 3.0 billion in cash.
Datwyler sells online distributor Reichelt With the sale of the online distributor Reichelt to Invision, Datwyler will now be specialising solely in system-critical elastomer components. The deal is due to be completed in the autumn.
GF and Qualcomm ink deal for 5G RF front-end products GlobalFoundries (GF), and Qualcomm Global Trading PTE. Ltd., a subsidiary of Qualcomm Technologies, are extending their RF collaboration on 5G multi-Gigabit speed RF front-end products.Load more news