InvenSense's (INVN) fourth-quarter earnings report went from bad to worse on Thursday. Although the company beat estimates on the top line, it couldn't translate the added revenue into better than expected earnings. The company earned $0.07 per share (on a non-GAAP basis) on revenue of $59 million. Meanwhile, the Street was looking for non-GAAP EPS of $0.10 on $57.4 million in revenue.

The news got worse when the company provided guidance for the current quarter. Analysts were modelling EPS of $0.16 and revenue of $69.1 million. The company guided for earnings of just $0.07 to $0.08 per share and revenue between $63 million and $66 million based on weakness at its top customer, Samsung (NASDAQOTH: SSNLF). As a result, the stock tanked more than 20% after hours.

The results also point to the company's need for increased diversification, and management spurred further speculation that it will win designs with Apple (AAPL -1.92%).

Let's take a deeper dive inside these numbers and find out what's really going on at InvenSense.

Factors driving down profits last quarter

  • Gross margin contraction. Gross margin fell to 46.3% compared to 49.9% in the same period last year. Management points to a higher mix of legacy products, which command lower ASPs and margins overall, as the reason for the contraction.

    Another factor could be the large percentage of revenue coming from a single customer -- Samsung. Samsung accounted for 47% of revenue last quarter. The company provides its best pricing to large customers, which could have an impact on gross margin.

    Next quarter, the company expects to return to a gross margin closer to 50% as the product mix shifts to its newer products. 

  • Operating expenses more than doubled. InvenSense has really pushed its research and development budget, reinvesting heavily in itself to further differentiate its products. The company also pushed its SG&A budget to capture more market share -- particularly in China.

    The sales team has attracted some strong interest in China, with Xiaomi leading the way. The region typically exhibits a bit more weakness in the first quarter, however, with the Chinese New Year driving OEM orders in the calendar fourth quarter.

    R&D expenses also included "increased costs associated with extensive new customer qualification activities." CEO Behrooz Abdi indicated these efforts have already resulted in new design wins and expects them to result in significant market share gains. Many are speculating that those design wins are in upcoming Apple products.

Factors driving down the guidance

  • Weakness at Samsung. Samsung accounted for 47% of the company's revenue last quarter. This quarter, management expects that number to fall back in line with its recent rate of about 35% of revenue.

    Unfortunately, it appears that the rate is going down due to weakness at Samsung, not strength at other OEMs. As a result, revenue guidance came in below expectations. After Samsung reported a decrease in mobile sales for its most recent quarter, it shouldn't be that big of a surprise.

    Samsung will get a boost from the release of the new Galaxy S5 this quarter, but its low-end phones are becoming increasingly marginalized by other OEMs. This is bad news for InvenSense, which is becoming increasingly reliant on Samsung's broad reach.

  • Continued R&D expenditures. For the upcoming quarter, management expects to spend $14.9 million on R&D. Comparatively, the company spent $8.1 million on R&D in its fiscal first quarter last year. 

    Many speculate, heavy spending on R&D could be tied to an opportunity at Apple. The iPhone maker is about the only company that could balance InvenSense's reliance on Samsung, as it sold over 150 million smartphones last year. Apple may also release a wearable device this year for which InvenSense is well suited to supply the MEMS chips.

    More likely, however, the R&D spending tied to the company's effort to transform itself into a company that provides a "full suite of motion and audio system on chip, or SoC, and embedded software." 

    That means the company is spending heavily to provide both hardware and software solutions for OEMs. This could be tied to the expected increase in wearable devices this year.

    Regardless of what it's for, the increased spending on R&D will drag down earnings in the near term, but offers potential for long-term benefits.

Is it still a buy?
InvenSense got hit hard by the market due to its poor results and weak guidance. Long term investors shouldn't fret, though. The investment thesis for InvenSense remains strong -- motion sensing and voice control are finding their way into more devices.

Although the company's seeing near-term pressure from increased expenses and heavy reliance on Samsung, its expenses look to be paying off. New design wins could add meaningfully to the company's guidance (which doesn't account for potential market share gain), and a win at Apple could mean serious upside for investors.