<PAGE>
                                                                     EXHIBIT 5.1


             [Letterhead of Wilson Sonsini Goodrich & Rosati, P.C.]

                                 April 16, 2002


Harmonic Inc.
549 Baltic Way

Sunnyvale, CA  94089

        RE: HARMONIC INC.--REGISTRATION STATEMENT ON FORM S-3

Ladies and Gentlemen:

        At your request, we have examined the Registration Statement on Form S-3
(No. 333-84430), including Amendment No. 1 thereto (the "REGISTRATION
STATEMENT"), filed or to be filed by Harmonic Inc., a Delaware corporation (the
"COMPANY"), with the Securities and Exchange Commission (the "COMMISSION") in
connection with the registration pursuant to the Securities Act of 1933, as
amended (the "ACT"), of the Securities (as defined below). The Registration
Statement relates to the proposed issuance and sale, from time to time pursuant
to Rule 415 under the Act as set forth in the Registration Statement, the
prospectus contained therein (the "PROSPECTUS") and the supplements to the
prospectus referred to therein (the "PROSPECTUS SUPPLEMENTS"), of up to an
aggregate offering price of $150,000,000 or the equivalent thereof, of the
Company's senior and subordinated debt securities (the "DEBT SECURITIES"),
shares of the Company's preferred stock, $0.001 par value per share (the
"PREFERRED STOCK"), shares of the Company's common stock, $0.001 par value per
share (the "COMMON STOCK"), and warrants to purchase shares of the Company's
Common Stock (the "WARRANTS") (the Debt Securities, the Preferred Stock, the
Common Stock, and the Warrants are collectively referred to herein as the
"SECURITIES").

        The Debt Securities are to be issued pursuant to a senior debt
securities indenture (the "SENIOR INDENTURE") and a subordinated debt securities
indenture (the "SUBORDINATED INDENTURE"), as applicable, both of which have been
filed as exhibits to the Registration Statement (the "INDENTURES") and are to be
entered into, in each case, between the Company and U.S. Bank National
Association, as trustee (the "TRUSTEE"). The Securities are to be sold pursuant
to an underwriting agreement (the "UNDERWRITING AGREEMENT") in substantially the
form to be filed under a Current Report on Form 8-K. The Debt Securities are to
be issued in the forms set forth in the Indentures filed as exhibits to the
Registration Statement. Each indenture may be supplemented, as applicable, in
connection with the issuance of each such series of Debt Securities, by a
supplemental indenture or other appropriate action of the Company creating such
series (each, a "SUPPLEMENTAL INDENTURE").


<PAGE>

Harmonic Inc.

April 16, 2002

Page 2


        We have examined instruments, documents, certificates and records which
we have deemed relevant and necessary for the basis of our opinion hereinafter
expressed. In such examination, we have assumed (i) the authenticity of original
documents and the genuineness of all signatures; (ii) the conformity to the
originals of all documents submitted to us as copies; (iii) the truth, accuracy,
and completeness of the information, representations and warranties contained in
the records, documents, instruments and certificates we have reviewed; (iv) the
Registration Statement, and any amendments thereto (including post-effective
amendments), will have become effective under the Act; (v) a prospectus
supplement will have been filed with the Commission describing the Securities
offered thereby; (vi) all Securities will be issued and sold in compliance with
applicable Federal and state securities laws and in the manner stated in the
Registration Statement and the applicable prospectus supplement; (vii) a
definitive purchase, underwriting or similar agreement with respect to any
Securities offered will have been duly authorized and validly executed and
delivered by the Company and the other parties thereto; (viii) any Securities
issuable upon conversion, exchange, redemption, or exercise of any Securities
being offered will be duly authorized, created and, if appropriate, reserved for
issuance upon such conversion, exchange, redemption, or exercise; and (ix) with
respect to shares of Common Stock or Preferred Stock offered, there will be
sufficient shares of Common Stock or Preferred Stock authorized under the
Company's organizational documents and not otherwise reserved for issuance.

        Based on such examination, we are of the opinion that:

        1. with respect to Debt Securities to be issued under either the Senior
Indenture or Subordinated Indenture, when (a) the Trustee is qualified to act as
Trustee under the Senior Indenture or Subordinated Indenture, as applicable, (b)
the Trustee has duly executed and delivered the Subordinated Indenture or Senior
Indenture, as applicable, (c) the Senior Indenture or Subordinated Indenture, as
applicable, has been duly authorized and validly executed and delivered by the
Company to the Trustee, (d) the Senior Indenture or Subordinated Indenture, as
applicable, has been duly qualified under the Trust Indenture Act of 1939, as
amended, (e) the Board of Directors of the Company or a duly constituted and
acting committee thereof (such Board of Directors or committee being hereinafter
referred to as the "BOARD") has taken all necessary corporate action to approve
the issuance and terms of such Debt Securities, the terms of the offering
thereof and related matters, and (f) such Debt Securities have been duly
executed, authenticated, issued and delivered in accordance with the provisions
of the Senior Indenture or Subordinated Indenture, as applicable, and the
applicable definitive purchase, underwriting or similar agreement approved by
the Board, such Debt Securities will be validly issued and will constitute valid
and binding obligations of the Company, enforceable against the Company in
accordance with their terms entitled to the benefits of the applicable
Indenture;

        2. with respect to any particular series of shares of Preferred Stock,
when both (a) the Board has taken all necessary corporate action to approve the
issuance and terms of the shares of Preferred Stock, the terms of the offering
thereof, and related matters, including the adoption of a certificate of
designation relating to such Preferred Stock conforming to the Delaware General


<PAGE>

Harmonic Inc.

April 16, 2002

Page 3


Corporation Law (a "CERTIFICATE") and the filing of the Certificate with the
Secretary of State of the State of Delaware, and (b) certificates representing
the shares of Preferred Stock have been duly executed, countersigned, registered
and delivered in accordance with the applicable definitive purchase,
underwriting or similar agreement approved by the Board, upon payment of the
consideration therefor (not less than the par value of the Preferred Stock)
provided for therein, then the shares of Preferred Stock will be validly issued,
fully paid and nonassessable;

        3. with respect to shares of Common Stock, when both (a) the Board has
taken all necessary corporate action to approve the issuance of and the terms of
the offering of the shares of Common Stock and related matters and (b)
certificates representing the shares of Common Stock have been duly executed,
countersigned, registered and delivered either (i) in accordance with the
applicable definitive purchase, underwriting or similar agreement approved by
the Board, or upon the exercise of Warrants to purchase Common Stock, upon
payment of the consideration therefor (not less than the par value of the Common
Stock) provided for therein, or (ii) upon conversion or exercise of any other
Security, in accordance with the terms of such Security or the instrument
governing such Security providing for such conversion or exercise as approved by
the Board, for the consideration approved by the Board (not less than the par
value of the Common Stock), then the shares of Common Stock will be validly
issued, fully paid and nonassessable; and

        4. with respect to the Warrants, when both (a) the Board has taken all
necessary corporate action to approve the issuance of and the terms of the
Warrants and related matters and (b) the Warrants have been duly executed and
delivered against payment therefor, pursuant to the applicable definitive
purchase, underwriting, warrant or similar agreement duly authorized, executed
and delivered by the Company and a warrant agent and the certificates for the
Warrants have been duly executed and delivered by the Company and such warrant
agent, then the Warrants will be validly issued, fully paid and nonassessable.

        Our opinion that any document is legal, valid and binding is qualified
as to:

        (a) limitations imposed by bankruptcy, insolvency, reorganization,
arrangement, fraudulent conveyance, moratorium or other laws relating to or
affecting the rights of creditors generally;

        (b) rights to indemnification and contribution which may be limited by
applicable law or equitable principles;

        (c) general principles of equity, including without limitation concepts
of materiality, reasonableness, good faith and fair dealing, and the possible
unavailability of specific performance or injunctive relief and limitation of
rights of acceleration, regardless of whether such enforceability is considered
in a proceeding in equity or at law.


<PAGE>

Harmonic Inc.

April 16, 2002

Page 4


        Attorneys at our Firm are admitted to the practice of law in the States
of New York and California and we express no opinion as to the laws of any other
jurisdiction other than the Federal laws of the United States of America and the
General Corporation Law of the State of Delaware.

        We hereby consent to the filing of this opinion as an exhibit to the
above-referenced Registration Statement and to the use of our name wherever it
appears in the Registration Statement, the Prospectus, the Prospectus
Supplement, and in any amendment or supplement thereto. In giving such consent,
we do not believe that we are "experts" within the meaning of such term as used
in the Act or the rules and regulations of the Commission issued thereunder with
respect to any part of the Registration Statement, including this opinion as an
exhibit or otherwise.


                                      WILSON SONSINI GOODRICH & ROSATI
                                      Professional Corporation

                                      /s/ Wilson Sonsini Goodrich & Rosati, P.C.


