© 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
onsemi divests Niigata, Japan fab onsemi continues to execute its "fab-liter" strategy and has completed of the sale of its Niigata, Japan facility to JS Foundry K.K.
Ixana raises $3M with wearable silicon chip Ixana, a wearable hardware company developing high-speed human-computer interfaces, has raised USD 3 million in funding backed by Uncorrelated Ventures, Samsung Next, Evonexus, Paradigm Shift and Hack VC.
STMicro and Soitec cooperate on SiC substrate manufacturing technology STMicroelectronics and Soitec announce the next stage of their cooperation on Silicon Carbide (SiC) substrates, with the qualification of Soitec’s SiC substrate technology by ST planned over the next 18 months.
Pendulum Instruments introduces a 4-channel Frequency Counter/Analyzer Pendulum Instruments, the global expert in time & frequency measurement, analysis, and calibration, announces today the release of the new CNT-104S Multi-channel Frequency Analyzer.
Intel is officially a landowner in Germany The US chip manufacturer has big plans for Europe and Germany in prearticular. The German city of Magdeburg won the lottery when Intel earlier this year announced that it would invest EUR 17 billion euros in a “leading-edge semiconductor fab mega-site”.
Kyocera AVX invests in Hentec/RPS system Kyocera AVX has purchased a Pulsar solderability testing system from Hentec Industries/RPS Automation for its Bangkok, Thailand facility.
Managing obsolescence: FED and COGD agree on cooperation The German Electronics Design and Manufacturing Association (FED) and the Component Obsolescence Group Deutschland (COGD) signed a cooperation agreement at Electronica in Munich.
Trading platform aims to alleviate chip shortage Precogs has launched CHIPSMARKET, an online marketplace for OEM-EMS-ODM businesses to trade chips directly between each other, with brokers, and with distributors.
Richardson portfolio with Gallium Semiconductor Richardson Electronics has entered into a a global distribution agreement with Gallium Semiconductor.
LITEON accelerates – inaugurates phase II Vietnam plant LITEON Technology says that the second phase of its manufacturing facility in Haiphong, Vietnam, has officially been inaugurated.
Layoffs await at GlobalFoundries as the company looks to cut costs The semiconductor manufacturer is planning to reduce its workforce as the company looks to navigate itself through a period of weaker demand and increased costs.
GlobalFoundries to tackle the supply chain with new appointment Ashlie Wallace will lead GlobalFoundries' global supply chain operations, including logistics, supply planning, sourcing, and procurement. She will step into her new role on November 28, 2022.
Filtronic opens new design centre in Manchester Filtronic, a designer and manufacturer of RF-to-mmWave components and subsystems, has recently employed several additional engineers to extend the capabilities of both its design team and its process engineering team. Adding to this expansion, the company has also opened a new design centre in Manchester, UK
Hunan Sanan secures order worth $524 million Hunan Sanan, a Sanan Optoelectronics subsidiary, has signed a procurement letter of intent (LOI) agreement with an automotive partner. Under the agreement, Hunan Sanan will supply USD 524 million worth of SiC chips to the automaker's new electric vehicle product line in the next few years.
The UK is looking into Broadcom’s acquisition of VMware The UK’s Competition and Markets Authority (CMA) is looking into whether chipmaker Broadcom’s USD 61 billion acquisition of VMware may substantially lessen competition.
Heilind's SVP Alan Clapp looks back at 2022 2022 has been a year of challenges for most companies, for connector specialist Heilind these challenges proved to be a "blessing in disguise" as they opened up a lot of customer opportunities due to the supply chain issues.
Cambridge GaN Devices secures funds to scale up The fabless semiconductor company has raised USD 19m in Series B funding. The investment will enable Cambridge GaN Devices (CGD) to begin mass production of its range of GaN transistors for power applications.
EU agree to foot €2.4 billion for satellite internet system The Council and the European Parliament reached a provisional agreement on a regulation establishing the EU's secure connectivity programme for the period 2023-2027.Load more news