Phantogram’s Josh Carter, left, makes the beats and Sarah Barthel sings the words. (Timothy Saccenti) Phantogram’s Josh Carter, left, makes the beats and Sarah Barthel sings the words. (Timothy Saccenti)

Big Boi was closing the windows on his computer screen when a song on a pop-up ad caught his attention. He opened the Shazam app on his phone and held it to the speakers. The artist: Phantogram. The track: “Mouthful of Diamonds.”

Soon after, the OutKast rapper featured the song as the jam of the week on his website. Phantogram, the indie-electronic duo made up of best friends Sarah Barthel and Josh Carter, was shocked — and ecstatic.

“It was hard for us to believe,” Barthel says. “We grew up on OutKast. We always looked to OutKast as a [model for how] we wanted to build our own career because they were so unique and their sound was so fresh.”

Big Boi invited the duo to his Atlanta studio for two weeks of jam sessions in January 2012 and Phantogram ended up working on three songs for his second solo album, “Vicious Lies and Dangerous Rumors.” Carter’s beats injected a futuristic, electronic flavor into the track “Objectum Sexuality,” while Barthel’s smooth vocals balanced out Big Boi’s rhymes in “CPU.”

The three friends now exchange new music and check in on one another frequently. Big Boi made a surprise appearance at Phantogram’s show in Atlanta last month, and they’re currently working on an EP together called “Big Grams,” Barthel says.

Phantogram’s beats have a hip-hop flavor, with hints of 808’s, analog synths, crispy snares and hi-hats. The overall sound is bombastic and high-energy, with Barthel’s vocals adding dreamlike whimsy. “Lights,” a particularly glitchy, beat-driven pop song, appears on the deluxe version of the soundtrack to last month’s blockbuster film “The Hunger Games: Catching Fire.”

Barthel says the duo’s music has been inspired by long drives out to the middle of nowhere and nights spent sitting underneath the stars and smoking cigarettes.

On “My Only Friend” (from the band’s sophomore album, “Voices,” due out early next year), you can “hear the crickets in the beginning and almost see the stars in a way,” Barthel says.

“When we write our songs we always have this visual idea behind them,” she adds. “They are little daydreams in our heads that we want to paint with sound.”

Barthel and Carter, childhood friends from Saratoga Springs, N.Y., live five blocks from each other in Brooklyn, N.Y., and hang out almost every day. Their tight chemistry shines through on record and onstage.

“I feel blessed that I get to experience this whirlwind of a life … with my best friend,” Barthel says. “It gives us that much more meaning and inspiration to keep going.”

9:30 Club, 815 V St. NW; Thu., 7 p.m., sold out; 202-265-0930. (U Street)