A fanfare of trumpets resounding from the great dome of St. Paul's Cathedral at 11 o'clock Wednesday morning will announce the arrival of Lady Dian Spencer for her royal wedding to Charles, the prince of Wales.

The wedding, the occasion for which 2,500 invited guests and a television audience of 750 million people around the world have been waiting, marks for Charles the final rite of royal passage before he eventually becomes the king of Great Britain and the head of the Commonwealth. The ceremony will make Diana the princess of Wales and future queen.

For Britian, a troubled nation going through a testing time, the glittering ceremony and attendant pageantry will be a reaffirmation of the institution of monarchy and an occasion for patriotic celebration.

The royal wedding appears to be a well-timed escape from Britain's current economic crisis, social stress and political uncertainty. The televised display of Britian's unparalled flair for regal ritual will replace, if not wipe away, recent images of riots in British cities and death and destruction in Brithish-ruled Northern Ireland.

The expense of the monarchy and the estimated million-dollar cost of the wedding at a time of increasing national hardship have been attacked by leftist groups and people who plan to protest Wednesday by crossing over to Ireland or France or by attending counter-wedding parties, picnics and rock-concerts in various parts of the country. But visible anitroyal sentiment has to far been siginificantly less than during the silver jubilee celebration of the prince's mother, Queen Elizabeth II, or Charles' investiture as prince of Wales.

Just after 6 a.m. on the east coast of America, early-rising Washingtonians will see the 20-year-old bride, wearing a white wedding dress of English silk with a 25-foot train, and the 32-year-old bridegroom, wearing a Royal Navy commander's uniform of dark blue venetian cloth trimmed in gold, stand before the archbishop of Canterbury as the dead of the cathedral declares: "Dearly beloved, we are gathered here in the sight of God and in the face of this congregation to join together this man and this woman in holy matrimony."

The congregation will contain most of the monarchs of Europe, a multitude of government leaders, diplomats from around the world and much of Britian's aristocracy. The ceremony will be the most glittering royal occasion since the coronation of Queen Elizabeth II in Westminister Abbey in 1953 and the most widely watched international event ever.

Charles is unlikely to be crowned king until the next century, because his mother is not expected to relinquish the throne for him. She and Charles, along with many of the country's strongest supporters of the monarchy, are known to believe there is no reason why Elizabeth II should depart from centuries of British royal tradition of reigning until death.

Besides the million or more spectators who will pack the two-mile procession route through London from Buckingham Palace to St. Paul's, many millions more who watch on television are expected to join afterward in thousands of street parties in London neighborhoods and villages, towns and cities cross the country. Socialites are staging facny soirees, hotels are holding wedding balls and local pubs are planning special fare and festivities.

"People seem inbued with the wedding," observed Patrick Montague-Smith, fomer editor of Debrett's Peerage and close observer of royalty, nobility and the rest of high society.

"It's like the carnival in Brazil," said an accountant's wife, who will be watching the wedding on television. "It takes people's minds off all the problems we have."

Some have argued here that a number of such opportunities in recent years for indulging in displays of pomp and affection for royal personages, whom many Britons regard as beloved members of a national extended family, have helped the country endure the darkest days of its long post-empire decline and have aided the monarchy in perpetuating itself. There was the queen's silver jubliee in 1977 and the queen mother's 80th birthday celebration last year. Now there is the wedding, and Britons expect to be celebrating the birth of the first child of the prince and princess of Wales by the end of next year.

Having a royal family in Britian, playwright John Osborne has said, "is like have one gold filing in a mouthful of decay."

Expressing a less cynical view, Montague-Smith said, "Economic and political difficulty has given the monarchy new importance." The outpouring of public reaction at the time of the queen's jubilee surprised a lot of people who thought the monarchy had slipped back in everyone's opinion," he added. "It showed the hold it still had on people."

"The monarchy has grown in importance," agreed Elizabeth Packenham, the countess of Langford, a noted British biographer, historian and journalist. "Having lasted for over a thousand years, it stands for something very stable -- for family, continuity and democracy -- and also for something romantic with the pagentry attaching to it. naturally, in a gray age, this is something people do enjoy."

The monarchy is Britian's oldest secular institution, with the queen able to trace her descent from King Egbert, who united all of England under his sovereignty in 829. Its continuity was broken only during the brief republican rule under Oliver Cromwell from 1649 to 1658.

Predating Parliament by four centuries and law courts by three, the monarch long exercised supreme power over all governmental functions. Establishment of a constitutional monarchy in the 17th century restricted the ruler's powers somewhat, but the soverign continued to appoint and dismiss most government ministers until the 19th century. As recently as 1963, the queen's remaining power to appoint the prime minister meant exercising real power, on the advice of elder statesman, when the Conservatives controlled Pariliament, because they were the last party to elect their own leader.

Today, the queen automatically appoints as prime minister the leader of the party winning a majority in Parliament. But if no majority party or coalition emerges after an election, she could have to make an important political decision in choosing someone to try to form a government or in deciding to dissolve a deadlocked Parliament. This nearly happened in 1974 and is a real possibility today, with British politics showing signs of a destablizing party realignment.

The queen sees all government papers, which she is reported to read throughly. She is expected to and does give her opinions on policy to the prime minister at weekly private meetings, even though the royal family believes it must avoid all political controversy in public.

Respected British journalist and author Charles Douglas-Home, who is studying the politics of the British monarchy, calls this remaining political influence and potential for power the queen's "presence" at the highest level of government. It has become enhanced, he argues, by Elizabeth II's long reign and her now considerable experience in governmental affairs, while prime ministers (eight so far) come and go.

But he warns in a special royal wedding magazine being published this week by the Times of London that the queen's influence -- and possibly the survival of the monarchy if she were forced to select a prime minister or dissolve Parliament -- depends on the monarchy's standing with the British people.

After surviving the overturning of thrones all over Europe at the time of World War I, the monarchy nearly touched bottom in public esteem when King Edward VIII abdicated to marry an American divorcee. But today polls show the monarchy enjoys the approval of four Britons out of five.

Queen Elizabeth, Prince Philip and their children have departed from stuffy tradition in many ways. They have made the royal family more visible through television and more accessible in person without giving up the pageantry, psychological distance or mystery of the monarchy. They have not become, like the royalty of Denmark or Holland, more like ordinary if wealthy citizens.

"I believe the balance is about right," Prince Charles said some years ago. "The monarchy is a symbol, I hope, of what is best in British life. Of course, I would change some things. But mystery is necessary. I believe we should be one step behind [what the public may want in the way of change] rather than two steps forward."

This is the answer, for now at least, to the question of abdication. A growing majority of Britons, according to public opinion polls, would like the queen to give up the throne to Charles before he becomes too old, even though the queen is popular and respected.

Charles would undoubtedly be well-prepared for the job. He is the first prince of Wales to be educated outside the palace at highly competitive schools, and the first to be given the same access to government papers as the sovereign. Unlike his immediate predecessors, King Edward VII and King Edward VIII, Charles has combined his undoubted devotion to polo, hunts, horse racing and other outdoor pursuits with serious study of statecraft and the problems and concerns of the British people.

But Charles has accepted the advice of his favorite uncle, the late Earl Mountbatten, an influential adviser to the queen, that she should not abdicate. Mountbatten believed that the longer the queen reigns the more valuable her long experience and support from her subjects will be to the country.